I am trying to make the simplest possible master image of a buildbot start that runs the buildbot start commands in the ENTRYPOINT/CMD Dockerfile .
I tried using many combinations of dumb-init , gosu and exec , but without success.
The situation is as follows:
When I try to start deamonized buildroot using the docker run -d -v $local/vol/bldbot/master:/var/lib/buildbot buildbot-master-test , the container starts successfully, but it terminates abruptly. The log is as follows:
[timestamp] [-] The log is open.
[timestamp] [-] twistd 16.0.0 (/ usr / bin / python 2.7.12), launch.
[timestamp] [-] reactor class: twisted.internet.epollreactor.EPollReactor.
[timestamp] [-] Running BuildMaster - buildbot.version: 0.9.2
[timestamp] [-] Downloading configuration from '/var/lib/buildbot/master.cfg'
[timestamp] [-] Setting up the database with the URL "sqlite: /state.sqlite"
[timestamp] [-] setting the database log mode to 'wal'
[timestamp] [-] housekeeping for master 1 c8aa8b0d5ca3: / var / lib / buildbot
[timestamp] [-] adding 1 new changes, deleting 0
[timestamp] [-] adding 1 new builders, removing 0
[timestamp] [-] adding 2 new schedulers, removing 0
[timestamp] [-] The web server is not configured on this host
[timestamp] [-] adding 1 new employees, removing 0
[timestamp] [-] PBServerFactory since 9989
[timestamp] [-] Starting the factory
[timestamp] [-] BuildMaster is working
When I launch the container interactively using the docker run --rm -it -v $local/vol/bldbot/master:/var/lib/buildbot buildbot-master-test /bin/sh and then run the buildbot start command Everything works like a spell.
I have already studied the contents of the official image of the original docker buildbot, i.e. buildbot/buildbot-master . I see that the authors decided to use the exec twistd -ny $B/buildbot.tac in start_buildbot.sh , rather than their own buildbot start .
So, the question is how to compile ENTRYPOINT/CMD instructions in a Docker file that just runs buildbot start .
APPENDIX 1
Dockerfile content
FROM alpine:3.4 ENV BASE_DIR=/var/lib/buildbot SRC_DIR=/usr/src/buildbot COPY start $SRC_DIR/ RUN \ echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \ echo @community http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \ apk add --no-cache \ python \ py-pip \ py-twisted \ py-cffi \ py-cryptography@community \ py-service_identity@community \ py-sqlalchemy@community \ gosu@testing \ dumb-init@community \ py-jinja2 \ tar \ curl && \ # install pip dependencies pip install --upgrade pip setuptools && \ pip install "buildbot" && \ rm -r /root/.cache WORKDIR $BASE_DIR RUN \ adduser -D -s /bin/sh bldbotmaster && \ chown bldbotmaster:bldbotmaster . VOLUME $BASE_DIR CMD ["dumb-init", "/usr/src/buildbot/start","buildbot","master"]
APPENDIX 2
start script content
#!/bin/sh set -e BASE_DIR=/var/lib/buildbot if [[ "$1" = 'buildbot' && "$2" = 'master' ]]; then if [ -z "$(ls -A "$BASE_DIR/master.cfg" 2> /dev/null)" ]; then gosu bldbotmaster buildbot create-master -r $BASE_DIR gosu bldbotmaster cp $BASE_DIR/master.cfg.sample $BASE_DIR/master.cfg fi exec gosu bldbotmaster buildbot start $BASE_DIR fi exec " $@ "
source share