Skip to content

Instantly share code, notes, and snippets.

@raphink
Last active February 11, 2019 22:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raphink/ecd67e3b74a976a0613c to your computer and use it in GitHub Desktop.
Save raphink/ecd67e3b74a976a0613c to your computer and use it in GitHub Desktop.
C2C blog post: Flexible Docker entrypoints scripts
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"]
#!/bin/sh
# Create user
useradd myservice
# Setup config
sed -i "s/PASSWD/${SERVICE_PASSWORD}/g" /etc/myservice.conf
# Start service
exec /usr/sbin/myservice "$@"
#!/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