Skip to content

Instantly share code, notes, and snippets.

@agross
Last active November 7, 2023 01:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agross/614b3c85dcc152e258403f4c5d4273b7 to your computer and use it in GitHub Desktop.
Save agross/614b3c85dcc152e258403f4c5d4273b7 to your computer and use it in GitHub Desktop.
Synology DS2415+ docker 17.05 does not support --build-arg
FROM busybox
ARG FOO
RUN env && echo $FOO
agross@firiel ~/Downloads/test
$ docker --version
Docker version 17.09.0-ce, build afdb6d4
agross@firiel ~/Downloads/test
$ docker build --no-cache --build-arg FOO=42 .
Sending build context to Docker daemon 2.048kB
Step 1/3 : FROM busybox
---> 6ad733544a63
Step 2/3 : ARG FOO
---> Running in 5905f0697f4e
---> 95f0e024daad
Removing intermediate container 5905f0697f4e
Step 3/3 : RUN env && echo $FOO
---> Running in 61b56de4056b
HOSTNAME=61b56de4056b
SHLVL=1
HOME=/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
FOO=42
PWD=/
42
---> 22d87fd43a05
Removing intermediate container 61b56de4056b
Successfully built 22d87fd43a05
$ docker --version
Docker version 17.05.0-ce, build 34ed091-synology
agross@NAS ~/test
$ docker build --no-cache --build-arg FOO=42 .
Sending build context to Docker daemon 2.048kB
Step 1/3 : FROM busybox
---> 6ad733544a63
Step 2/3 : ARG FOO
---> Running in 98bb102c933b
---> 85a15904257a
Removing intermediate container 98bb102c933b
Step 3/3 : RUN env && echo $FOO
---> Running in 1b1f68c48247
HOSTNAME=98bb102c933b
SHLVL=1
HOME=/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
---> e961ab1e9c53
Removing intermediate container 1b1f68c48247
Successfully built e961ab1e9c53
@suelm
Copy link

suelm commented Jun 29, 2018

is there a solution?

@CrystalMethod
Copy link

FROM busybox

ARG FOO
ENV FOO=$FOO

RUN env && echo $FOO

doesn't look nice but works

@mhofman
Copy link

mhofman commented Jan 11, 2019

This is insane! Been banging my head on this for over an hour now!

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