Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.