Skip to content

Instantly share code, notes, and snippets.

@leanderjanssen
Created April 12, 2017 08:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save leanderjanssen/dda386fc9e8667ff2d97fc0d56b6f51e to your computer and use it in GitHub Desktop.
Save leanderjanssen/dda386fc9e8667ff2d97fc0d56b6f51e to your computer and use it in GitHub Desktop.
Example of a Dockerfile with LABEL and ARG

Example of using LABEL and ARG in a Dockerfile

Dockerfile

FROM ubuntu:14.04
RUN apt-get -y update
RUN apt-get -y install vim
RUN apt-get -y install curl
ARG GIT_COMMIT=unknown
LABEL git-commit=$GIT_COMMIT

Building the image

docker build -t test --build-arg GIT_COMMIT=0123456789 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment