diff options
Diffstat (limited to 'OS')
-rw-r--r-- | OS/Dockerfile | 2 | ||||
-rw-r--r-- | OS/README.md | 2 | ||||
-rw-r--r-- | OS/sx.sh | 34 |
3 files changed, 5 insertions, 33 deletions
diff --git a/OS/Dockerfile b/OS/Dockerfile index 2b47905..f04434e 100644 --- a/OS/Dockerfile +++ b/OS/Dockerfile @@ -3,5 +3,7 @@ MAINTAINER Christophe LARUE <dev@startx.fr> COPY sx.sh /bin/sx RUN chmod 775 /bin/sx +RUN useradd startx && echo "startx" | passwd --stdin startx && usermod -aG wheel startx +USER startx CMD [ "/bin/sx" ] diff --git a/OS/README.md b/OS/README.md index ff1d247..3609af5 100644 --- a/OS/README.md +++ b/OS/README.md @@ -1,6 +1,6 @@ # Docker OS Images : Centos7 -Simple container used to have an os container running in openshift and ready to investigate using sysadmin tools. This image is based on [centos/s2i-core-centos7](https://hub.docker.com/r/centos/s2i-core-centos7) done by [sclorg](https://github.com/sclorg/s2i-base-container/tree/master/core). Official image for all openshift s2i containers. +Simple container used to have an os container running in openshift and ready to investigate using sysadmin tools. This image is based on [centos/s2i-core-centos7](https://hub.docker.com/r/centos/s2i-core-centos7) done by [sclorg](https://github.com/sclorg/s2i-base-container/tree/master/core). You can find information on this image and how to use it by visiting the [Dockerhub registry](https://github.com/startxfr/docker-images) @@ -1,41 +1,13 @@ #!/bin/bash export TERM=xterm pid=0 -printenv -function check_environment { - if [ ! -v CONTAINER_TYPE ]; then - CONTAINER_TYPE="unknown" - export CONTAINER_TYPE - echo "! WARNING : environment var CONTAINER_TYPE is missing..." - echo "! WARNING : auto-assigned value : $CONTAINER_TYPE" - fi - if [ ! -v CONTAINER_SERVICE ]; then - CONTAINER_SERVICE=$CONTAINER_TYPE; - export CONTAINER_SERVICE; - echo "! WARNING : environment var CONTAINER_SERVICE is missing..." - echo "! WARNING : auto-assigned value : $CONTAINER_SERVICE" - fi - if [ ! -v CONTAINER_INSTANCE ]; then - CONTAINER_INSTANCE=$CONTAINER_TYPE "_" $CONTAINER_SERVICE; - export CONTAINER_INSTANCE; - echo "! WARNING : environment var CONTAINER_INSTANCE is missing..." - echo "! WARNING : auto-assigned value : $CONTAINER_INSTANCE" - fi -} function display_container_header { echo "+=====================================================" echo "| Container : $HOSTNAME" echo "| OS : $(</etc/redhat-release)" - if [ -v CONTAINER_TYPE ]; then - echo "| Type : $CONTAINER_TYPE" - fi - if [ -v CONTAINER_SERVICE ]; then - echo "| Service : $CONTAINER_SERVICE" - fi - if [ -v CONTAINER_INSTANCE ]; then - echo "| Instance : $CONTAINER_INSTANCE" - fi + echo "| kubernetes : $KUBERNETES_SERVICE_HOST" + echo "| user : $(</etc/whoami)" echo "+=====================================================" } @@ -49,7 +21,5 @@ function start_service { done } - -check_environment display_container_header start_service
\ No newline at end of file |