I have a dockerfile which takes a build arg (it's an access token). This dockerfile is referenced as the build of a service in docker-compose.yml. running docker-compose build --build-arg PAT=mytoken builds successfully, but running docker app build --build-arg PAT=mytoken . -t mytag fails, the docker build has not recieved that build argument:
...
ARG PAT
RUN test -n "$PAT"
...
Steps to reproduce the issue:
Specify ARG PAT in dockerfile
use dockerfile in service with build: dockerfile:
run docker app build with corresponding --build-arg key=value argument
Describe the results you received:
argument is not available during docker build; RUN test -n "$PAT" does fails.
Describe the results you expected:
argument is available during docker build; RUN test -n "$PAT" does not fail.
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker version:
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:23:10 2020
OS/Arch: windows/amd64
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:29:16 2020
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
Description
I have a dockerfile which takes a build arg (it's an access token). This dockerfile is referenced as the build of a service in docker-compose.yml. running
docker-compose build --build-arg PAT=mytoken
builds successfully, but runningdocker app build --build-arg PAT=mytoken . -t mytag
fails, the docker build has not recieved that build argument:Steps to reproduce the issue:
--build-arg key=value
argumentDescribe the results you received: argument is not available during docker build;
RUN test -n "$PAT"
does fails.Describe the results you expected: argument is available during docker build;
RUN test -n "$PAT"
does not fail.Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker app version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.): Windows Home insider build using WSL 2.0 docker backend