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 --- 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 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 115 deletions(-) delete mode 100644 OS/run.sh delete mode 100644 OS/sx-lib.sh create mode 100644 OS/sx.sh (limited to 'OS') 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 : $(