From f18d78bb5330bf8916f9785cea22a74dcc1531c9 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sat, 5 Oct 2019 07:26:37 +0200 Subject: Reorganize make procedure for adei-mini --- adei-mini/Dockerfile | 44 --------------------------------- adei-mini/Makefile | 20 --------------- adei-mini/files/docker-entrypoint.sh | 14 ----------- adei-mini/files/openshift-entrypoint.sh | 17 ------------- adei/Dockerfile.mini | 44 +++++++++++++++++++++++++++++++++ adei/Makefile | 24 +++++++++++++++--- 6 files changed, 65 insertions(+), 98 deletions(-) delete mode 100644 adei-mini/Dockerfile delete mode 100644 adei-mini/Makefile delete mode 100755 adei-mini/files/docker-entrypoint.sh delete mode 100755 adei-mini/files/openshift-entrypoint.sh create mode 100644 adei/Dockerfile.mini diff --git a/adei-mini/Dockerfile b/adei-mini/Dockerfile deleted file mode 100644 index 4845c18..0000000 --- a/adei-mini/Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -FROM chsa/microadei:latest -MAINTAINER Suren A. Chilingaryan - -VOLUME /adei - -ENV ADEI_REVISION=last:1 \ - ADEI_PARALLEL=sources \ - ADEI_SETUP=all \ - ADEI_ENABLED_SETUPS="autogen logs" \ - ADEI_PORTS=80 \ - APACHE_SERVERS=0 \ - MYSQL_SERVER=adei-mysql \ - MYSQL_PORT=3306 \ - MYSQL_USER=adei \ - MYSQL_PASSWORD=adei \ - MYSQL_DATABASE=adei \ - LANG=en_US.UTF-8 \ - LANGUAGE=en_US:en \ - LC_ALL=en_US.UTF-8 - -COPY files/ / - -RUN bash -c 'mkdir -p /adei/{src,cfg,tmp,sys,log,mail}' && \ - \ -# Replace packaged ADEI with repository version - mkdir -p /srv/www/htdocs && \ - ln -s /adei/src /srv/www/htdocs/adei && \ - for name in $(find /srv -mindepth 1 -maxdepth 1 -name '*.sh'); do rm "$name"; ln -s "/adei/src/scripts/cron/$(basename $name)" "$name"; done && \ - rm -f /etc/cron.d/adei.cron && \ - ln -s /adei/src/scripts/cron/adei.cron /etc/cron.d/adei.cron && \ - \ -# Consolidate all volumes in /adei - rm -rf /var/spool/mail && \ - ln -s /adei/log /var/spool/mail && \ - \ -# Modify for non-priviledged mode - chmod +rx /etc/php5/conf.d && \ - \ -# Ugly python needs to resolve user name - chmod g=u /etc/passwd - - -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD /bin/bash diff --git a/adei-mini/Makefile b/adei-mini/Makefile deleted file mode 100644 index ba30242..0000000 --- a/adei-mini/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -all: build -install: push - -.PHONY: deps rebuild build push start stop restart bash - -deps: - docker pull chsa/microadei:latest - -build: deps Dockerfile - docker build --tag chsa/adei-minimal:latest . -# docker build --squash --tag chsa/adei-minimal-squashed:latest . - -rebuild: Dockerfile - docker build --no-cache --tag chsa/adei-minimal:latest . - -push: build - docker push chsa/adei-minimal:latest - -bash: build - docker exec -it adei-minimal /bin/bash diff --git a/adei-mini/files/docker-entrypoint.sh b/adei-mini/files/docker-entrypoint.sh deleted file mode 100755 index 6f0fa88..0000000 --- a/adei-mini/files/docker-entrypoint.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/bash - -set -e - -mkdir -p /adei/{src,cfg,tmp,sys,log} - -if ! whoami &> /dev/null; then - if [ -w /etc/passwd ]; then - echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd - fi -fi - -echo "Running: $@" -exec "$@" diff --git a/adei-mini/files/openshift-entrypoint.sh b/adei-mini/files/openshift-entrypoint.sh deleted file mode 100755 index 9353b5d..0000000 --- a/adei-mini/files/openshift-entrypoint.sh +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/bash - -mkdir -p /adei/{src,cfg,tmp,sys,log} - - -while [ ! -f /adei/cfg/.ready ]; do - echo "Waiting for ADEI intialization..." - sleep 5 -done - -while [ ! -f "$1" ]; do - echo "The script $1 is not populated yet. Waiting...." - sleep 1 -done - -echo "Running: $@" -exec /bin/bash "$@" diff --git a/adei/Dockerfile.mini b/adei/Dockerfile.mini new file mode 100644 index 0000000..4845c18 --- /dev/null +++ b/adei/Dockerfile.mini @@ -0,0 +1,44 @@ +FROM chsa/microadei:latest +MAINTAINER Suren A. Chilingaryan + +VOLUME /adei + +ENV ADEI_REVISION=last:1 \ + ADEI_PARALLEL=sources \ + ADEI_SETUP=all \ + ADEI_ENABLED_SETUPS="autogen logs" \ + ADEI_PORTS=80 \ + APACHE_SERVERS=0 \ + MYSQL_SERVER=adei-mysql \ + MYSQL_PORT=3306 \ + MYSQL_USER=adei \ + MYSQL_PASSWORD=adei \ + MYSQL_DATABASE=adei \ + LANG=en_US.UTF-8 \ + LANGUAGE=en_US:en \ + LC_ALL=en_US.UTF-8 + +COPY files/ / + +RUN bash -c 'mkdir -p /adei/{src,cfg,tmp,sys,log,mail}' && \ + \ +# Replace packaged ADEI with repository version + mkdir -p /srv/www/htdocs && \ + ln -s /adei/src /srv/www/htdocs/adei && \ + for name in $(find /srv -mindepth 1 -maxdepth 1 -name '*.sh'); do rm "$name"; ln -s "/adei/src/scripts/cron/$(basename $name)" "$name"; done && \ + rm -f /etc/cron.d/adei.cron && \ + ln -s /adei/src/scripts/cron/adei.cron /etc/cron.d/adei.cron && \ + \ +# Consolidate all volumes in /adei + rm -rf /var/spool/mail && \ + ln -s /adei/log /var/spool/mail && \ + \ +# Modify for non-priviledged mode + chmod +rx /etc/php5/conf.d && \ + \ +# Ugly python needs to resolve user name + chmod g=u /etc/passwd + + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD /bin/bash diff --git a/adei/Makefile b/adei/Makefile index eb40411..1a88f6f 100644 --- a/adei/Makefile +++ b/adei/Makefile @@ -1,7 +1,25 @@ -all: build -install: push +all: build build-mini +mini: build-mini +install: push push-mini +install-mini: push-mini -.PHONY: rebuild build push start stop restart bash +.PHONY: rebuild build push start stop restart bash mini install-mini deps-mini build-mini rebuild-mini push-mini bash-mini + +deps-mini: + docker pull chsa/microadei:latest + +build-mini: deps-mini Dockerfile.mini + docker build -f Dockerfile.mini --tag chsa/adei-minimal:latest . +# docker build -f Dockerfile.mini --tag chsa/adei-minimal-squashed:latest --squash . + +rebuild-mini: deps-mini Dockerfile.mini + docker build -f Dockerfile.mini --tag chsa/adei-minimal:lates --no-cache . + +push-mini: build-mini + docker push chsa/adei-minimal:latest + +bash-mini: build-mini + docker exec -it adei-minimal /bin/bash build: Dockerfile docker build --tag chsa/adei:latest . -- cgit v1.2.3