zell
zell

Reputation: 10204

How to specify GIT_ACCESS_TOKEN for the docker build command?

I run this command

docker build  GIT_ACCESS_TOKEN=my_token  -t "${IMAGE}" .

and got this error

"docker build" requires exactly 1 argument.
See 'docker build --help'.

Usage:  docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile

But as you see above, I do have a dot at the end of the docker build command. Besides, docker build . -t "${IMAGE}" works for me, so it seems the error is introduced at GIT_ACCESS_TOKEN part?

Upvotes: 1

Views: 940

Answers (1)

ItayB
ItayB

Reputation: 11357

Are you looking for build-arg?

docker build --build-arg GIT_ACCESS_TOKEN=my_token -t "${IMAGE}" .

Upvotes: 2

Related Questions