From baf7c43307fb29f5c19b237f418f4f1a59749c3c Mon Sep 17 00:00:00 2001 From: startxfr Date: Sun, 23 Jul 2017 13:43:36 +0200 Subject: adding openshift OS + Bomb for mem and cpu crash test on openshift --- Applications/rockmongo/Dockerfile | 25 -------------- Applications/rockmongo/README.md | 43 ------------------------ Bombs/README.md | 28 ++++++++++++++++ Bombs/cpu/Dockerfile | 8 +++++ Bombs/cpu/README.md | 69 +++++++++++++++++++++++++++++++++++++++ Bombs/cpu/bomb.sh | 5 +++ Bombs/cpu/docker-compose.yml | 8 +++++ Bombs/cpu/sx.sh | 65 ++++++++++++++++++++++++++++++++++++ Bombs/mem/Dockerfile | 8 +++++ Bombs/mem/README.md | 69 +++++++++++++++++++++++++++++++++++++++ Bombs/mem/bomb.sh | 7 ++++ Bombs/mem/docker-compose.yml | 10 ++++++ Bombs/mem/sx.sh | 65 ++++++++++++++++++++++++++++++++++++ OS/Dockerfile | 17 +++------- OS/README.md | 32 +++++++----------- OS/docker-compose.yml | 15 +++------ OS/run.sh | 6 ---- OS/sx-lib.sh | 65 ------------------------------------ OS/sx.sh | 55 +++++++++++++++++++++++++++++++ 19 files changed, 417 insertions(+), 183 deletions(-) delete mode 100644 Applications/rockmongo/Dockerfile delete mode 100644 Applications/rockmongo/README.md create mode 100644 Bombs/README.md create mode 100644 Bombs/cpu/Dockerfile create mode 100644 Bombs/cpu/README.md create mode 100644 Bombs/cpu/bomb.sh create mode 100644 Bombs/cpu/docker-compose.yml create mode 100644 Bombs/cpu/sx.sh create mode 100644 Bombs/mem/Dockerfile create mode 100644 Bombs/mem/README.md create mode 100644 Bombs/mem/bomb.sh create mode 100644 Bombs/mem/docker-compose.yml create mode 100644 Bombs/mem/sx.sh delete mode 100644 OS/run.sh delete mode 100644 OS/sx-lib.sh create mode 100644 OS/sx.sh diff --git a/Applications/rockmongo/Dockerfile b/Applications/rockmongo/Dockerfile deleted file mode 100644 index d714576..0000000 --- a/Applications/rockmongo/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM startx/sv-php -MAINTAINER startx dev@startx.fr - -# update, install required, clean -RUN yum -y update && yum install -y httpd php php-devel wget php-pear unzip gcc-c++ make && yum clean all - -# update pecl channels -RUN pecl update-channels - -# install mongo drivers without Cyrus SASL (MongoDB Enterprise Authentication) -RUN printf "no\n" | pecl install mongo && cd /etc && echo "extension=mongo.so" >> /etc/php.d/mongo.ini - -# install RockMongo -RUN cd /root && wget -O rockmongo-1.1.5.zip http://rockmongo.com/downloads/go?id=12 && unzip rockmongo-1.1.5.zip -d /var/www/ && rm -R /var/www/html && mv /var/www/rockmongo/ /var/www/html - -# increase php upload size -RUN sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 10M/g' /etc/php.ini && sed -i 's/post_max_size = 2M/post_max_size = 10M/g' /etc/php.ini - -# expose php information -RUN echo '' > /var/www/html/info.php - -# Expose ports -EXPOSE 80 - -CMD [ "/usr/sbin/httpd", "-D", "FOREGROUND" ] \ No newline at end of file diff --git a/Applications/rockmongo/README.md b/Applications/rockmongo/README.md deleted file mode 100644 index 10bb5b1..0000000 --- a/Applications/rockmongo/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# STARTX Application docker-images : Rockmongo - -Container running rockmongo under a fedora server. - -## Running from docker registry - - docker run -d -p 80:80 --name="rockmongo" startx/app-rockmongo - when linked to another container - docker run -d --name="mongo" startx/sv-mongo - docker run -d -p 80:80 --name="rockmongo" --link mongo:mongo startx/app-rockmongo - -## Build and run from local Dockerfile -### Building docker image -Copy sources in your docker host - - mkdir startx-docker-images; - cd startx-docker-images; - git clone https://github.com/startxfr/docker-images.git . - -Build the container - - docker build -t startx/app-rockmongo Applications/rockmongo/ - -### Running local image - - docker run -d -p 80:80 --name="rockmongo" startx/app-rockmongo - -## Accessing server -access to the running webserver - - firefox http://localhost:80/rockmongo - -access to the container itself - - docker exec -it rockmongo bash - -## Related Resources -* [Sources files](https://github.com/startxfr/docker-images/tree/master/Applications/rockmongo) -* [Github STARTX profile](https://github.com/startxfr/docker-images) -* [Docker registry for this container](https://registry.hub.docker.com/u/startx/app-rockmongo/) -* [Docker registry for Fedora](https://registry.hub.docker.com/u/fedora/) - - diff --git a/Bombs/README.md b/Bombs/README.md new file mode 100644 index 0000000..47ed719 --- /dev/null +++ b/Bombs/README.md @@ -0,0 +1,28 @@ +# STARTX Docker-Images Bombs test Repository + +This directory host various Open Source applications into docker containers based on [startx/fedora container](https://hub.docker.com/r/startx/fedora) + +You can use it to instanciate new container from the dockerhub public registry +or as a parent container in your own container's. +These container are provided with CentOS openshift build image in order to be run under openshift Container Plateform + +Please **read each container manual** for more information on how you can use it in +your project and start using stable or experimental applications in your applications + +| [![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) | [Sources](https://github.com/startxfr/docker-images/) | [STARTX Profile](https://github.com/startxfr) | +|-------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|-------------------------------------------------------------------|-----------------------------------------------| + +## Available applications + +| Service | Docker Hub repository | CentOS flavours | Doc | +|-----------------|-----------------------------------------------------------------------------------|-----------------|--------------------------------------------| +| bomb-cpu | [`startx/openshift-bomb-cpu`](https://hub.docker.com/r/startx/openshift-bomb-cpu) | `:latest` | [manual](pma/README.md) | +| bomb-mem | [`startx/openshift-bomb-mem`](https://hub.docker.com/r/startx/openshift-bomb-mem) | `:latest` | [manual](rockmongo/README.md) | + + +## Running from dockerhub registry + +| Bombs | Command | +|--------------------|-------------------------------------------------------------------------| +| **bomb-cpu** | `docker run -d -p 80:80 --name="bombcpu" startx/openshift-bomb-cpu` | +| **bomb-mem** | `docker run -d -p 80:80 --name="bombmem" startx/openshift-bomb-mem` | diff --git a/Bombs/cpu/Dockerfile b/Bombs/cpu/Dockerfile new file mode 100644 index 0000000..2a37769 --- /dev/null +++ b/Bombs/cpu/Dockerfile @@ -0,0 +1,8 @@ +FROM centos/s2i-core-centos7:latest +MAINTAINER Christophe LARUE + +COPY sx.sh /bin/sx +COPY bomb.sh /bin/bomb +RUN chmod 775 /bin/sx /bin/bomb + +CMD [ "/bin/sx" ] diff --git a/Bombs/cpu/README.md b/Bombs/cpu/README.md new file mode 100644 index 0000000..1b7358d --- /dev/null +++ b/Bombs/cpu/README.md @@ -0,0 +1,69 @@ +# Docker Bomb Images : CPU + +Simple container used to bomb cpu usage for crash testing. !!! WARNING, starting this container will start flooding your CPU by default for 10sec. + +You can find information on this image and how to use it by visiting the [Dockerhub registry](https://github.com/startxfr/docker-images) + +| [![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-bomb-cpu) | [Sources](https://github.com/startxfr/docker-images/Bombs/) | [STARTX Profile](https://github.com/startxfr) | +|-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|----------------------------------------------------------------------|-----------------------------------------------| + +## Running from dockerhub registry + +* with `docker` you can run `docker run -it --name="centos" startx/openshift-bomb-cpu` from any docker host +* with `docker-compose` you can create a docker-compose.yml file with the following content +``` +fedora: + image: startx/openshift-bomb-cpu:latest + container_name: "os-ocp-bomb-cpu" + environment: + CONTAINER_TYPE: "bomb" + CONTAINER_SERVICE: "cpu" + CONTAINER_INSTANCE: "os-ocp-bomb-cpu" +``` + +## 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/openshift-bomb-cpu:latest +#... your container specifications +CMD ["/bin/sx"] +``` + +## Environment variable + +| Variable | Type | Mandatory | Description | +|---------------------------|----------|-----------|--------------------------------------------------------------------------| +| CONTAINER_INSTANCE | `string` | `yes` | Container name. Should be uning to get fine grained log and application reporting +| CONTAINER_TYPE | `string` | `no` | Container family (os, service, application. could be enhanced +| CONTAINER_SERVICE | `string` | `no` | Define the type of service or application provided +| HOSTNAME | `auto` | `auto` | Container unique id automatically assigned by docker daemon at startup +| TEST_DURATION | `seconds`| `auto` | Running test duration (defautl = 10sec) + + +## For advanced users + +You you want to use this container and code to build and create locally this container. You can follow theses instructions to setup and working environment. + +This section will help you if you want to : +* Get latest version of this container Bombs +* Enhance container content by adding instruction in Dockefile before build step + +You must have a working environment with the source code of this repository. Read and follow [how to setup your working environment](https://github.com/startxfr/docker-images#setup-your-working-environment-mandatory) to get a working directory. The following instructions assume you are at the top level of your working directory. + +### Build & run a container using `docker` + +1. Jump into the container directory with `cd Bombs/cpu` +2. Build the container using `docker build -t bomb-cpu .` +3. Run this container + 1. Interactively with `docker run -it bomb-cpu`. If you add a last parameter (like `/bin/bash`) to will run this command instead of the default entrypoint. Usefull to interact with this container (ex: `/bin/bash`, `/bin/ps -a`, `/bin/df -h`,...) + 2. As a daemon with `docker run -d bomb-cpu` + + +### Build & run a container using `docker-compose` + +1. Jump into the container directory with `cd Bombs/cpu` +2. Run this container + 1. Interactively with `docker-compose up` Startup logs appears and escaping this command stop the container + 2. As a daemon with `docker-compose up -d`. Container startup logs can be read using `docker-compose logs` + diff --git a/Bombs/cpu/bomb.sh b/Bombs/cpu/bomb.sh new file mode 100644 index 0000000..b6f3050 --- /dev/null +++ b/Bombs/cpu/bomb.sh @@ -0,0 +1,5 @@ +#!/bin/bash +while true +do + echo 'boum! ' +done \ No newline at end of file diff --git a/Bombs/cpu/docker-compose.yml b/Bombs/cpu/docker-compose.yml new file mode 100644 index 0000000..f0f9b2e --- /dev/null +++ b/Bombs/cpu/docker-compose.yml @@ -0,0 +1,8 @@ +bomb-cpu: + build: ./ + container_name: "os-ocp-bomb-cpu" + environment: + CONTAINER_TYPE: "bomb" + CONTAINER_SERVICE: "cpu" + CONTAINER_INSTANCE: "os-ocp-bomb-cpu" + TEST_DURATION: 8 \ No newline at end of file diff --git a/Bombs/cpu/sx.sh b/Bombs/cpu/sx.sh new file mode 100644 index 0000000..2f2607a --- /dev/null +++ b/Bombs/cpu/sx.sh @@ -0,0 +1,65 @@ +#!/bin/bash +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 : $( /dev/null & + else + TEST_DURATION=10; + fi + echo "+=====================================================" + echo "| Container $HOSTNAME is now bombing CPU for $TEST_DURATION sec" + echo "+=====================================================" + /bin/bomb > /dev/null & + TASK_PID=$! + sleep $TEST_DURATION + kill $TASK_PID + exit 0 +} + + +check_environment +display_container_header +start_service \ No newline at end of file diff --git a/Bombs/mem/Dockerfile b/Bombs/mem/Dockerfile new file mode 100644 index 0000000..2a37769 --- /dev/null +++ b/Bombs/mem/Dockerfile @@ -0,0 +1,8 @@ +FROM centos/s2i-core-centos7:latest +MAINTAINER Christophe LARUE + +COPY sx.sh /bin/sx +COPY bomb.sh /bin/bomb +RUN chmod 775 /bin/sx /bin/bomb + +CMD [ "/bin/sx" ] diff --git a/Bombs/mem/README.md b/Bombs/mem/README.md new file mode 100644 index 0000000..7597326 --- /dev/null +++ b/Bombs/mem/README.md @@ -0,0 +1,69 @@ +# Docker Bomb Images : mem + +Simple container used to bomb mem usage for crash testing. !!! WARNING, starting this container will start flooding your mem by default for 10sec. + +You can find information on this image and how to use it by visiting the [Dockerhub registry](https://github.com/startxfr/docker-images) + +| [![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-bomb-mem) | [Sources](https://github.com/startxfr/docker-images/Bombs/) | [STARTX Profile](https://github.com/startxfr) | +|-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|----------------------------------------------------------------------|-----------------------------------------------| + +## Running from dockerhub registry + +* with `docker` you can run `docker run -it --name="centos" startx/openshift-bomb-mem` from any docker host +* with `docker-compose` you can create a docker-compose.yml file with the following content +``` +fedora: + image: startx/openshift-bomb-mem:latest + container_name: "os-ocp-bomb-mem" + environment: + CONTAINER_TYPE: "bomb" + CONTAINER_SERVICE: "mem" + CONTAINER_INSTANCE: "os-ocp-bomb-mem" +``` + +## 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/openshift-bomb-mem:latest +#... your container specifications +CMD ["/bin/sx"] +``` + +## Environment variable + +| Variable | Type | Mandatory | Description | +|---------------------------|----------|-----------|--------------------------------------------------------------------------| +| CONTAINER_INSTANCE | `string` | `yes` | Container name. Should be uning to get fine grained log and application reporting +| CONTAINER_TYPE | `string` | `no` | Container family (os, service, application. could be enhanced +| CONTAINER_SERVICE | `string` | `no` | Define the type of service or application provided +| HOSTNAME | `auto` | `auto` | Container unique id automatically assigned by docker daemon at startup +| TEST_DURATION | `seconds`| `auto` | Running test duration (defautl = 10sec) + + +## For advanced users + +You you want to use this container and code to build and create locally this container. You can follow theses instructions to setup and working environment. + +This section will help you if you want to : +* Get latest version of this container Bombs +* Enhance container content by adding instruction in Dockefile before build step + +You must have a working environment with the source code of this repository. Read and follow [how to setup your working environment](https://github.com/startxfr/docker-images#setup-your-working-environment-mandatory) to get a working directory. The following instructions assume you are at the top level of your working directory. + +### Build & run a container using `docker` + +1. Jump into the container directory with `cd Bombs/mem` +2. Build the container using `docker build -t bomb-mem .` +3. Run this container + 1. Interactively with `docker run -it bomb-mem`. If you add a last parameter (like `/bin/bash`) to will run this command instead of the default entrypoint. Usefull to interact with this container (ex: `/bin/bash`, `/bin/ps -a`, `/bin/df -h`,...) + 2. As a daemon with `docker run -d bomb-mem` + + +### Build & run a container using `docker-compose` + +1. Jump into the container directory with `cd Bombs/mem` +2. Run this container + 1. Interactively with `docker-compose up` Startup logs appears and escaping this command stop the container + 2. As a daemon with `docker-compose up -d`. Container startup logs can be read using `docker-compose logs` + diff --git a/Bombs/mem/bomb.sh b/Bombs/mem/bomb.sh new file mode 100644 index 0000000..a24d108 --- /dev/null +++ b/Bombs/mem/bomb.sh @@ -0,0 +1,7 @@ +#!/bin/bash +VARMEM=$(mount) +VARMEM="$VARMEM alejf iuoyzefdsljfhefgdsknchs,dmlqf,chlsegfcdkfhsjcgsqkfcgsqf" +while true +do + VARMEM="$VARMEM $VARMEM $VARMEM $VARMEM $VARMEM $VARMEM $VARMEM $VARMEM " +done \ No newline at end of file diff --git a/Bombs/mem/docker-compose.yml b/Bombs/mem/docker-compose.yml new file mode 100644 index 0000000..0cc6823 --- /dev/null +++ b/Bombs/mem/docker-compose.yml @@ -0,0 +1,10 @@ +bomb-mem: + build: ./ + container_name: "os-ocp-bomb-mem" + mem_limit: 50m + memswap_limit: 300m + environment: + CONTAINER_TYPE: "bomb" + CONTAINER_SERVICE: "mem" + CONTAINER_INSTANCE: "os-ocp-bomb-mem" + TEST_DURATION: 15 \ No newline at end of file diff --git a/Bombs/mem/sx.sh b/Bombs/mem/sx.sh new file mode 100644 index 0000000..fd9115e --- /dev/null +++ b/Bombs/mem/sx.sh @@ -0,0 +1,65 @@ +#!/bin/bash +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 : $( /dev/null & + else + TEST_DURATION=10; + fi + echo "+=====================================================" + echo "| Container $HOSTNAME is now bombing MEM for $TEST_DURATION sec" + echo "+=====================================================" + /bin/bomb > /dev/null & + TASK_PID=$! + sleep $TEST_DURATION + kill $TASK_PID + exit 0 +} + + +check_environment +display_container_header +start_service \ No newline at end of file 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 -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 diff --git a/OS/sx-lib.sh b/OS/sx-lib.sh deleted file mode 100644 index 3d9691a..0000000 --- a/OS/sx-lib.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -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 : $(