Skip to content

Instantly share code, notes, and snippets.

@pennyfx
Created December 14, 2016 03:42
Show Gist options
  • Save pennyfx/bd7d2e9811c019fe7d203cb034991ac6 to your computer and use it in GitHub Desktop.
Save pennyfx/bd7d2e9811c019fe7d203cb034991ac6 to your computer and use it in GitHub Desktop.
Docker snippets

Pass git commit to docker image

ARG GIT_COMMIT

ENV GIT_COMMIT ${GIT_COMMIT}
# pass git commit hash to container
docker build --build-arg GIT_COMMIT=$(git rev-parse --short HEAD) -t integration-api .
console.log(process.env.GIT_COMMIT)
=> '587503f'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment