From 11621aff584557c0141cef87b6e229f382349e9e Mon Sep 17 00:00:00 2001 From: startxfr Date: Sun, 23 Jul 2017 14:23:43 +0200 Subject: change user setting in openshift centos image to be compliant with openshift container policy --- Bombs/cpu/sx.sh | 34 ++-------------------------------- Bombs/mem/sx.sh | 34 ++-------------------------------- OS/Dockerfile | 2 ++ OS/README.md | 2 +- OS/sx.sh | 34 ++-------------------------------- 5 files changed, 9 insertions(+), 97 deletions(-) diff --git a/Bombs/cpu/sx.sh b/Bombs/cpu/sx.sh index 2f2607a..e028787 100644 --- a/Bombs/cpu/sx.sh +++ b/Bombs/cpu/sx.sh @@ -2,40 +2,12 @@ export TERM=xterm pid=0 -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 : $( 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) diff --git a/OS/sx.sh b/OS/sx.sh index 96a8448..5bf4d17 100644 --- a/OS/sx.sh +++ b/OS/sx.sh @@ -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 : $(