Last active
February 11, 2019 22:38
-
-
Save raphink/ecd67e3b74a976a0613c to your computer and use it in GitHub Desktop.
C2C blog post: Flexible Docker entrypoints scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COPY /docker-entrypoint.sh / | |
COPY /docker-entrypoint.d/* /docker-entrypoint.d/ | |
ONBUILD COPY /docker-entrypoint.d/* /docker-entrypoint.d/ | |
ENTRYPOINT ["/docker-entrypoint.sh", "/opt/puppetlabs/puppet/bin/mcollectived"] | |
CMD ["--no-daemonize"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Create user | |
useradd myservice | |
# Setup config | |
sed -i "s/PASSWD/${SERVICE_PASSWORD}/g" /etc/myservice.conf | |
# Start service | |
exec /usr/sbin/myservice "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR=/docker-entrypoint.d | |
if [[ -d "$DIR" ]] | |
then | |
/bin/run-parts --verbose "$DIR" | |
fi | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment