From 18a451ed0758a4f9736fd4ac68d3c51e4ea8d773 Mon Sep 17 00:00:00 2001 From: startxfr Date: Sat, 28 Nov 2015 14:13:04 +0100 Subject: change in os startup --- OS/Dockerfile | 5 ++++- OS/docker-compose.yml | 8 ++++++-- OS/run.sh | 4 ++++ OS/sx-lib.sh | 18 ++++++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 OS/run.sh create mode 100644 OS/sx-lib.sh (limited to 'OS') diff --git a/OS/Dockerfile b/OS/Dockerfile index ce00afb..878005c 100644 --- a/OS/Dockerfile +++ b/OS/Dockerfile @@ -7,4 +7,7 @@ RUN dnf -y install deltarpm pwgen tar python-dnf-plugins-extras-migrate && \ dnf-2 migrate && \ dnf -y install psmisc coreutils findutils wget logrotate && \ dnf clean all -RUN mkdir -p /sx +COPY *.sh /bin/ +RUN chmod 775 /bin/sx-lib.sh /bin/run.sh + +CMD ["/bin/run.sh"] diff --git a/OS/docker-compose.yml b/OS/docker-compose.yml index 65ce1f3..c79d5d9 100644 --- a/OS/docker-compose.yml +++ b/OS/docker-compose.yml @@ -4,5 +4,9 @@ server: container_name: "sx-fedora" mem_limit: 1g memswap_limit: 2g - cpu_shares: 4096 - restart: "on-failure:2" \ No newline at end of file + cpu_shares: 2 + restart: "on-failure:2" + environment: + CONTAINER_SERVICE: "os" + CONTAINER_TYPE: "fedora" + CONTAINER_INSTANCE: "sx-fedora" \ No newline at end of file diff --git a/OS/run.sh b/OS/run.sh new file mode 100644 index 0000000..ca12432 --- /dev/null +++ b/OS/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash +source /bin/sx-lib.sh + +display_container_header \ No newline at end of file diff --git a/OS/sx-lib.sh b/OS/sx-lib.sh new file mode 100644 index 0000000..2fcb5aa --- /dev/null +++ b/OS/sx-lib.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +export TERM=dumb + +function display_container_header { + echo "+=====================================================" + echo "| Container : $HOSTNAME" + if [ -v CONTAINER_TYPE ]; then + echo "| Type : $CONTAINER_TYPE" + fi + if [ -v CONTAINER_INSTANCE ]; then + echo "| Instance : $CONTAINER_INSTANCE" + fi + if [ -v CONTAINER_SERVICE ]; then + echo "| Service : $CONTAINER_SERVICE" + fi + echo "+=====================================================" +} -- cgit v1.2.3