Skip to content

Instantly share code, notes, and snippets.

@pmbauer
Created September 23, 2016 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmbauer/0302fe5611db678e3a22e255e3b29c1b to your computer and use it in GitHub Desktop.
Save pmbauer/0302fe5611db678e3a22e255e3b29c1b to your computer and use it in GitHub Desktop.
FROM alpine:3.4
ARG FOO
ADD test.sh .
RUN ./test.sh
$ docker build --build-arg FOO=BAR -t test .
Sending build context to Docker daemon 3.072 kB
Step 1 : FROM alpine:3.4
 ---> 4e38e38c8ce0
Step 2 : ARG FOO
 ---> Running in c5c23c421a6c
 ---> b251b85eefb1
Removing intermediate container c5c23c421a6c
Step 3 : ADD test.sh .
 ---> 86b3a69480a6
Removing intermediate container 7951d7e2806a
Step 4 : RUN ./test.sh
 ---> Running in 9540d627df3f
BAR
 ---> 028dce4ef40a
Removing intermediate container 9540d627df3f
Successfully built 028dce4ef40a
#!/bin/sh
echo $FOO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment