Skip to content

Instantly share code, notes, and snippets.

@sonnysideup
Last active September 7, 2016 14:12
Show Gist options
  • Save sonnysideup/4c374103f8158075c1248348fb3f5138 to your computer and use it in GitHub Desktop.
Save sonnysideup/4c374103f8158075c1248348fb3f5138 to your computer and use it in GitHub Desktop.
Building a base image using envconsul
FROM envconsul:latest
# how can i set the prefix here? preceding the cmd seems ugly
CMD ["my-command", "arg1", "argN"]
FROM base:latest
#
# install steps
#
ENTRYPOINT ["/path/to/envconsul"]
#!/bin/sh
if [ -z "$CONSUL" ]; then
echo "WARNING! Consul not available, running locally."
$@
else
/usr/local/bin/envconsul \
-config=/etc/envconsul.hcl \
-consul=${CONSUL_SERVER}:8500 \
-prefix=${CONSUL_PREFIX:-/} $@
fi
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment