diff options
Diffstat (limited to 'OS')
-rw-r--r-- | OS/Dockerfile | 17 | ||||
-rw-r--r-- | OS/README.md | 32 | ||||
-rw-r--r-- | OS/docker-compose.yml | 15 | ||||
-rw-r--r-- | OS/run.sh | 6 | ||||
-rw-r--r-- | OS/sx.sh (renamed from OS/sx-lib.sh) | 28 |
5 files changed, 29 insertions, 69 deletions
diff --git a/OS/Dockerfile b/OS/Dockerfile index 9e2d163..2b47905 100644 --- a/OS/Dockerfile +++ b/OS/Dockerfile @@ -1,16 +1,7 @@ -FROM fedora:rawhide +FROM centos/s2i-core-centos7:latest MAINTAINER Christophe LARUE <dev@startx.fr> -USER root -# Install minimal packages -RUN dnf -y install pwgen tar psmisc procps findutils iputils net-tools wget logrotate zip && \ - dnf clean all -ENV STARTUPLOG=/logs/startup.log \ - LOG_PATH=/logs -COPY *.sh /bin/ -RUN chmod 775 /bin/sx-lib.sh /bin/run.sh && \ - mkdir /data /logs && \ - touch $STARTUPLOG +COPY sx.sh /bin/sx +RUN chmod 775 /bin/sx -VOLUME $LOG_PATH -CMD [ "/bin/run.sh" ] +CMD [ "/bin/sx" ] diff --git a/OS/README.md b/OS/README.md index d776462..ff1d247 100644 --- a/OS/README.md +++ b/OS/README.md @@ -1,43 +1,35 @@ -# Docker OS Images : FEDORA +# Docker OS Images : Centos7 -Simple container used for all startx based services and applications published in [Dockerhub registry](https://github.com/startxfr/docker-images). -This container contain updated core OS rpm (kernel, libs,...) as well as usefull tools like pwgen, tar, zip, psmisc, procps, coreutils, findutils, wget - -| [![Build Status](https://travis-ci.org/startxfr/docker-images.svg?branch=master)](https://travis-ci.org/startxfr/docker-images) | [Dockerhub Registry](https://hub.docker.com/r/startx/fedora) | [Sources](https://github.com/startxfr/docker-images/OS/) | [STARTX Profile](https://github.com/startxfr) | -|-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|----------------------------------------------------------------------|-----------------------------------------------| +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. +You can find information on this image and how to use it by visiting the [Dockerhub registry](https://github.com/startxfr/docker-images) -## Container flavours +This container contain updated core OS rpm (kernel, libs,...) as well as usefull tools like pwgen, tar, zip, psmisc, procps, coreutils, findutils, wget -| Version | Docker Hub repository | Fedora distribution | -|------------|-------------------------------------------------------------------------|---------------------------------------------| -| Latest | [`startx/fedora:latest`](https://hub.docker.com/r/startx/fedora) | Fedora 24 (kernel 4.x + GNU 3.xx ) | -| 23 | [`startx/fedora:23`](https://hub.docker.com/r/startx/fedora) | Fedora 23 (kernel 4.2 + GNU 3.18 ) | -| 22 | [`startx/fedora:22`](https://hub.docker.com/r/startx/fedora) | Fedora 22 (kernel 4.0 + GNU 3.16 ) | -| 21 | [`startx/fedora:21`](https://hub.docker.com/r/startx/fedora) | Fedora 21 (kernel 3.16 + GNU 3.14 ) | -| 20 | [`startx/fedora:20`](https://hub.docker.com/r/startx/fedora) | Fedora 20 (kernel 3.11 + GNU 3.10 ) | +| [![Build Status](https://travis-ci.org/startxfr/docker-images.svg?branch=openshift)](https://travis-ci.org/startxfr/docker-images) | [Dockerhub Registry](https://hub.docker.com/r/startx/openshift-centos) | [Sources](https://github.com/startxfr/docker-images/OS/) | [STARTX Profile](https://github.com/startxfr) | +|-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|----------------------------------------------------------------------|-----------------------------------------------| ## Running from dockerhub registry -* with `docker` you can run `docker run -it --name="fedora" startx/fedora` from any docker host +* with `docker` you can run `docker run -it --name="centos" startx/openshift-centos` from any docker host * with `docker-compose` you can create a docker-compose.yml file with the following content ``` fedora: - image: startx/fedora:latest - container_name: "os-fedora" + image: startx/openshift-centos:latest + container_name: "os-ocp-centos7" environment: CONTAINER_TYPE: "os" CONTAINER_SERVICE: "fedora" - CONTAINER_INSTANCE: "os-fedora" + CONTAINER_INSTANCE: "os-ocp-centos7" ``` ## Using this image in your own container You can use this Dockerfile template to start a new personalized container based on this container ``` -FROM startx/fedora:latest +FROM startx/openshift-centos:latest #... your container specifications -CMD ["/bin/run.sh"] +CMD ["/bin/sx"] ``` ## Environment variable diff --git a/OS/docker-compose.yml b/OS/docker-compose.yml index ca465fe..11b457b 100644 --- a/OS/docker-compose.yml +++ b/OS/docker-compose.yml @@ -1,14 +1,7 @@ -fedora: +centos: build: ./ - container_name: "os-fedora" - mem_limit: 1g - memswap_limit: 1g - cpu_shares: 2 - restart: "on-failure:2" - privileged: true + container_name: "os-ocp-centos7" environment: CONTAINER_TYPE: "os" - CONTAINER_SERVICE: "fedora" - CONTAINER_INSTANCE: "os-fedora" - volumes: - - "/tmp/container/logs/fedora:/logs"
\ No newline at end of file + CONTAINER_SERVICE: "centos7" + CONTAINER_INSTANCE: "os-ocp-centos7"
\ No newline at end of file diff --git a/OS/run.sh b/OS/run.sh deleted file mode 100644 index e491694..0000000 --- a/OS/run.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -source /bin/sx-lib.sh - -check_environment | tee -a $STARTUPLOG -display_container_header | tee -a $STARTUPLOG -start_service
\ No newline at end of file @@ -1,5 +1,4 @@ #!/bin/bash - export TERM=xterm pid=0 @@ -40,26 +39,17 @@ function display_container_header { echo "+=====================================================" } -function stop_handler { - echo "+=====================================================" | tee -a $STARTUPLOG - echo "| Container $HOSTNAME is now STOPPED" | tee -a $STARTUPLOG - echo "+=====================================================" | tee -a $STARTUPLOG - if [ $pid -ne 0 ]; then - kill -SIGTERM "$pid" - wait "$pid" - fi - exit 143; # 128 + 15 -- SIGTERM -} - function start_service { - trap 'kill ${!}; stop_handler' SIGHUP SIGINT SIGQUIT SIGTERM SIGKILL SIGSTOP SIGCONT - echo "+=====================================================" | tee -a $STARTUPLOG - echo "| Container $HOSTNAME is now RUNNING" | tee -a $STARTUPLOG - echo "+=====================================================" | tee -a $STARTUPLOG - tail -f /dev/null & - pid="$!" + echo "+=====================================================" + echo "| Container $HOSTNAME is now RUNNING" + echo "+=====================================================" while true do - tail -f /dev/null & wait ${!} + echo "live... (next try in 10sec)" & sleep 10 done } + + +check_environment +display_container_header +start_service
\ No newline at end of file |