dockerfile --platform option of the FROM instruction not work - docker
Docker version:
my base_image with multiple architecture:

Dockerfile:
I use FROM --platform=linux/arm64 ${base_image} to force use the arm64 image but it does not work. Then I checked the image on this machine and found the arch of the image is amd64, so I doubt it has something to do with the local image.
so I change the base_image force to arm64 and re-build:
Magic happens!!!
So, my question is why --platform of FROM does not work? Why docker does not perform docker pull --platform instead it depends on my local machine image.
PS: I'm sorry I had to desensitize some sensitive words and it will affect your reading.
-------------------------reproduce on windows PC-------------------------------------------------
fengyq#DESKTOP-918EPFF:~$ docker version
Client: Docker Engine - Community
Cloud integration: 1.0.14
Version: 20.10.6
API version: 1.41
Go version: go1.13.15
Git commit: 370c289
Built: Fri Apr 9 22:46:45 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.6
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 8728dd2
Built: Fri Apr 9 22:44:56 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.4
GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
runc:
Version: 1.0.0-rc93
GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
docker-init:
Version: 0.19.0
GitCommit: de40ad0
fengyq#DESKTOP-918EPFF:~$ cat Dockerfile
FROM --platform=linux/arm64 golang:1.16-alpine
RUN go version
fengyq#DESKTOP-918EPFF:~$ docker pull golang:1.16-alpine
1.16-alpine: Pulling from library/golang
Digest: sha256:5616dca835fa90ef13a843824ba58394dad356b7d56198fb7c93cbe76d7d67fe
Status: Downloaded newer image for golang:1.16-alpine
docker.io/library/golang:1.16-alpine
fengyq#DESKTOP-918EPFF:~$ docker image inspect golang:1.16-alpine|grep Architecture -A2
"Architecture": "amd64",
"Os": "linux",
"Size": 301868964,
# It will not download the image specified in FROM instruction, see the `go version` output
fengyq#DESKTOP-918EPFF:~$ docker build --no-cache . -t test
Sending build context to Docker daemon 122.4kB
Step 1/2 : FROM --platform=linux/arm64 golang:1.16-alpine
---> 7642119cd161
Step 2/2 : RUN go version
---> Running in 7d020707da41
go version go1.16.15 linux/amd64
Removing intermediate container 7d020707da41
---> 26c1c4bf971e
Successfully built 26c1c4bf971e
Successfully tagged test:latest
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
The --platform parameter was introduced in buildkit, and I tend to recommend that for most builds now:
$ DOCKER_BUILDKIT=1 docker build -t test-platform -f df.platform --progress plain --no-cache .
#1 [internal] load build definition from df.platform
#1 sha256:5c840b4d7475cccb1fc86fce5ee78796e600289df0bb6de6c73430d268e9389d
#1 transferring dockerfile: 38B done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 sha256:1140f41a9b3ce804e3b52ff100b4cad659a81a19c059e58d6dc857c0e367c821
#2 transferring context: 34B done
#2 DONE 0.0s
#3 [internal] load metadata for docker.io/library/golang:1.16-alpine
#3 sha256:066c23f588b92c8811e28ac05785cd295f354b1e7f60b3e42c4008ec173536c2
#3 DONE 0.2s
#4 [1/2] FROM docker.io/library/golang:1.16-alpine#sha256:5616dca835fa90ef13a843824ba58394dad356b7d56198fb7c93cbe76d7d67fe
#4 sha256:d20c37de2e493c7729ae105da84b8907178eed8cc5d1a935db9a50e2370830c2
#4 CACHED
#5 [2/2] RUN go version
#5 sha256:158e1ccd4f04dd9d9e1d7cb1008671d8b25cf42ff017d0f2fce6cc08899a77f4
#5 0.529 go version go1.16.15 linux/arm64
#5 DONE 0.5s
#6 exporting to image
#6 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#6 exporting layers 0.0s done
#6 writing image sha256:3901f37e2cfca681676cd6c6043d3b88594664c44b1f4e873c183e0a200852d5 done
#6 naming to docker.io/library/test-platform done
#6 DONE 0.0s
With the classic builder, it will default to the already existing image on the host, and only pull a new one when the image doesn't exist or when you specify --pull:
$ DOCKER_BUILDKIT=0 docker build -t test-platform -f df.platform .
Sending build context to Docker daemon 23.04kB
Step 1/2 : FROM --platform=linux/arm64 golang:1.16-alpine
---> df1795ddbf41
Step 2/2 : RUN go version
---> Running in f53586180318
go version go1.16.8 linux/amd64
Removing intermediate container f53586180318
---> a250bd04bb4b
Successfully built a250bd04bb4b
Successfully tagged test-platform:latest
$ DOCKER_BUILDKIT=0 docker build -t test-platform --pull -f df.platform .
Sending build context to Docker daemon 23.04kB
Step 1/2 : FROM --platform=linux/arm64 golang:1.16-alpine
1.16-alpine: Pulling from library/golang
9b3977197b4f: Already exists
1a89e8eeedd5: Already exists
94645a83ff95: Already exists
7ed97893b138: Already exists
57a2943bcc95: Already exists
Digest: sha256:5616dca835fa90ef13a843824ba58394dad356b7d56198fb7c93cbe76d7d67fe
Status: Downloaded newer image for golang:1.16-alpine
---> 4a5e4084930e
Step 2/2 : RUN go version
---> [Warning] The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested
---> Running in 5a0893533b89
go version go1.16.15 linux/arm64
Removing intermediate container 5a0893533b89
---> 2dd93e25714a
Successfully built 2dd93e25714a
Successfully tagged test-platform:latest
Related
Docker ARG variables not working (always empty)
Why are the ARG variables in my dockerfile are always empty? Command docker build --rm --force-rm --no-cache -f ./Dockerfile Dockerfile ARG APP_NAME='ground-station' FROM node:current AS build-node WORKDIR /${APP_NAME} RUN echo "APP_NAME=${APP_NAME}" Output Sending build context to Docker daemon 1.199MB Step 1/4 : ARG APP_NAME='ground-station' Step 2/4 : FROM node:current AS build-node ---> 6e72986b1b6e Step 3/4 : WORKDIR /${APP_NAME} ---> Running in 39f12e36d4a1 Removing intermediate container 39f12e36d4a1 ---> 93f5cdef6402 Step 4/4 : RUN echo "APP_NAME=${APP_NAME}" ---> Running in a18ac6f3bee8 APP_NAME= Removing intermediate container a18ac6f3bee8 ---> 746cea84bb8f Successfully built 746cea84bb8f On step 4, APP_NAME is always empty. I searched for a solution but all I've found is this. I tried with --no-cache but it still doesn't work. Output of docker version Client: Docker Engine - Community Version: 20.10.5 API version: 1.41 Go version: go1.13.15 Git commit: 55c4c88 Built: Tue Mar 2 20:17:52 2021 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.5 API version: 1.41 (minimum version 1.12) Go version: go1.13.15 Git commit: 363e9a8 Built: Tue Mar 2 20:15:47 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.4 GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e runc: Version: 1.0.0-rc93 GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec docker-init: Version: 0.19.0 GitCommit: de40ad0
ARG steps are scoped. Before the first FROM step, the ARG only applies to FROM steps. And within each FROM step, it only applies to the lines after that ARG step until the next FROM (in a multistage build). To fix this, reorder your steps: FROM node:current AS build-node ARG APP_NAME='ground-station' WORKDIR /${APP_NAME} RUN echo "APP_NAME=${APP_NAME}"
How to get Docker to stop using cached images or layers
I have a fairly simple Dockerfile that I am trying to build locally before pushing to Azure DevOps for CI/CD usage. The build is falling on the last line (the cause is not the purpose of this post) and I am trying to get the complete build process to "start over". No matter what I do, Docker continues to use cached layers (images??) despite me deleting everything and telling the system to not use cache. FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build WORKDIR /src # Personal access token to access Artifacts feed ARG ACCESS_TOKEN ARG ARTIFACTS_ENDPOINT # Install the Credential Provider to configure the access RUN apk add bash RUN wget -qO- https://aka.ms/install-artifacts-credprovider.sh | bash # Configure the environment variables ENV NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED true ENV VSS_NUGET_EXTERNAL_FEED_ENDPOINTS "{\"endpointCredentials\": [{\"endpoint\":\"${ARTIFACTS_ENDPOINT}\", \"password\":\"${ACCESS_TOKEN}\"}]}" COPY . . WORKDIR /src/Announcements.UI RUN dotnet restore -s ${ARTIFACTS_ENDPOINT} -s https://api.nuget.org/v3/index.json RUN dotnet build --no-restore -c Release -o /app/build FROM build as publish RUN dotnet publish --no-restore -c Release -o /app/publish FROM nginx:alpine AS final WORKDIR /usr/share/nginx/html COPY --from=publish /app/publish/wwwroot . COPY nginx.conf /etc/nginx/nginx.conf I am executing the build using the following command docker builder build --build-arg ARTIFACTS_ENDPOINT=https://pkgs.dev.azure.com/some-url --build-arg ACCESS_TOKEN=some-token --pull --no-cache --progress plain -f .\Announcements.UI\Dockerfile . As you can see, I am specifying both no-cache and pull arguments. Both docker image ls --all and docker container ls --all show nothing. I have also executed the following commands docker builder prune docker build prune docker container prune docker system prune --all docker system prune --volumes --all And maybe a few others that I cannot even remember as I have been researching this issue. Unless I edit the beginning lines of the Dockerfile first, no matter what I do, the output ends up being similar to #1 [internal] load build definition from Dockerfile #1 sha256:cbdbb2aa8016147768da39aaa3cf4a88c42355ea185072e6aec7d1bf37e95a95 #1 transferring dockerfile: 32B done #1 DONE 0.0s #2 [internal] load .dockerignore #2 sha256:935b1c32fc5d8819aedb2128b068f58f226088632b15af29f9cf4caac88bd889 #2 transferring context: 35B done #2 DONE 0.0s #3 [internal] load metadata for docker.io/library/nginx:alpine #3 sha256:b001d263a254f0e4960d52c837d5764774ef80ad3878c61304052afb6e0e9af2 #3 ... #4 [internal] load metadata for mcr.microsoft.com/dotnet/sdk:5.0-alpine #4 sha256:84368650d7715857ce3c251a792ea9a04a39b0cbc02b73ef90801d4be2c05b0f #4 DONE 0.3s #3 [internal] load metadata for docker.io/library/nginx:alpine #3 sha256:b001d263a254f0e4960d52c837d5764774ef80ad3878c61304052afb6e0e9af2 #3 DONE 0.5s #11 [internal] load build context #11 sha256:123b3b80e7c135f4e2816bbcb5f2d704566ade8083a56fd10e8f2c6825b85db4 #11 transferring context: 6.41kB 0.0s done #11 DONE 0.1s #10 [build 4/8] RUN wget -qO- https://aka.ms/install-artifacts-credprovider.sh | bash #10 sha256:d9ba90bfb15e2bafe5ba7621cd63377af7ec0ae7b30029507d2f41d88a17b7ed #10 CACHED #9 [build 3/8] RUN apk add bash #9 sha256:a05883759b40f77aae0edcc00f1048f10b8e8c066a9aadd59a10fc879d4fd4df #9 CACHED #12 [build 5/8] COPY . . #12 sha256:46509fe5fec5bb4235463dc240239f2529e48bcdc26909f0fb6861c97987ae93 #12 CACHED #15 [build 8/8] RUN dotnet build --no-restore -c Release -o /app/build #15 sha256:5f43c86c41c36f567ea0679b642bc7a5a8adc889d090b9b101f11440d7f22699 #15 CACHED ... As you can see, some commands are still coming from cached results. My docker version info is docker version Client: Docker Engine - Community Cloud integration: 1.0.7 Version: 20.10.2 API version: 1.41 Go version: go1.13.15 Git commit: 2291f61 Built: Mon Dec 28 16:14:16 2020 OS/Arch: windows/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.2 API version: 1.41 (minimum version 1.12) Go version: go1.13.15 Git commit: 8891c58 Built: Mon Dec 28 16:15:28 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.3 GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b runc: Version: 1.0.0-rc92 GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff docker-init: Version: 0.19.0 GitCommit: de40ad0
could be related to this bug: https://github.com/moby/buildkit/issues/1939 Try switching off buildkit by setting an environment variable DOCKER_BUILDKIT=0
copying * files in Docker to directory gives error
I have the following Dockerfile FROM openjdk:8-jdk-alpine RUN mkdir -p /webpieces COPY * /webpieces WORKDIR "/webpieces" ENTRYPOINT ["./bin/webpiecesexample"] When I build like so, I get the following error Deans-MacBook-Pro:webpiecesexample dean$ docker build -t gcr.io/braided-topic/webpieces2 . Sending build context to Docker daemon 75.56MB Step 1/5 : FROM openjdk:8-jdk-alpine ---> a3562aa0b991 Step 2/5 : RUN mkdir -p /webpieces ---> Running in bc615c0cd540 Removing intermediate container bc615c0cd540 ---> 69a2f4530c44 Step 3/5 : COPY * /webpieces When using COPY with more than one source file, the destination must be a directory and end with a / When I trim the DockerFile and just build with the first two lines and then run with a basic shell to view the directories, I see the webpieces directory there docker run -it --entrypoint sh gcr.io/braided-topic-266113/webpieces2 I can cd into webpieces and everything. Why is the copy command not working here? docker version here: Deans-MacBook-Pro:distributions dean$ docker version Client: Docker Engine - Community Version: 19.03.5 API version: 1.40 Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:22:34 2019 OS/Arch: darwin/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 19.03.5 API version: 1.40 (minimum version 1.12) Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:29:19 2019 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.2.10 GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339 runc: Version: 1.0.0-rc8+dev GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 docker-init: Version: 0.18.0 GitCommit: fec3683
When using COPY with more than one source file, the destination must be a directory and end with a /. Change the COPY line to COPY * /webpieces/ ...it seems to copy the contents of each directory instead of the directories themselves. I would prefer not to name each directory I am moving as we prefer auto-add when we make changes. Use . instead of * and it'll preserve all the nesting. COPY . /webpieces/
Passing argument to dockerfile not working well
I'm having some trouble with passing argument value to dockerfile. Running docker in Windows Server 2016 My docker version info is PS C:\Users\Administrator\Desktop> docker version Client: Docker Engine - Enterprise Version: 19.03.4 API version: 1.40 Go version: go1.12.10 Git commit: 9e27c76fe0 Built: 10/17/2019 23:42:50 OS/Arch: windows/amd64 Experimental: false Server: Docker Engine - Enterprise Engine: Version: 19.03.4 API version: 1.40 (minimum version 1.24) Go version: go1.12.10 Git commit: 9e27c76fe0 Built: 10/17/2019 23:41:23 OS/Arch: windows/amd64 Experimental: false and powershell opened as administrator. My reference is this. But it not worked for me. So this is my dockerfile. FROM microsoft/iis ARG a_version RUN echo $a_version Also i tried many different types of echo value Such as RUN echo "$a_version" RUN echo ${a_version} RUN echo "${a_version}" And this is my execute command. docker build . --build-arg a_version=1234 My expected result was print 1234 But actual result was PS C:\Users\Administrator\Desktop> docker build . --build-arg a_version=1234 Sending build context to Docker daemon 14.04MB Step 1/3 : FROM microsoft/iis ---> 595015675977 Step 2/3 : ARG a_version ---> Running in 91698d9e71da Removing intermediate container 91698d9e71da ---> 2bad94a2ce74 Step 3/3 : RUN echo $a_version ---> Running in 3fe25ecb813c $a_version Why it happens? How can is fix it?
In Windows Command-Prompt the syntax is echo %a_version% as your base image is based on window. how-can-i-display-the-contents-of-an-environment-variable-from-the-command-promp So you can change this to FROM microsoft/iis ARG a_version RUN echo %a_version% env in window dockerfile
I had to do something simmilar and this is a piece of code that worked for me. ARG PORT_SITE ENV PORT_SITE ${PORT_SITE} and then I refer it in the entrypoint as following $env:PORT_SITE That's the way I did it, but i suppose that you can ommit the env variable and just refer to the arg value using ${PORT_SITE}
Unspecified error (0x80004005) while running a Docker build
Going thought the onboarding first steps of docker https://hub.docker.com/?overlay=onboarding , I run into an issue when running the build command docker build -t <user>/cheers2019 . The error happend at the 6th step, with code error (0x80004005). I am running docker on windows with windows containers. The full error code: Sending build context to Docker daemon 13.31kB Step 1/9 : FROM golang:1.11-alpine AS builder ---> e116d2efa2ab Step 2/9 : RUN apk add --no-cache git ---> Using cache ---> 07f79e350f69 Step 3/9 : RUN go get github.com/pdevine/go-asciisprite ---> Using cache ---> cfe4fd4064c3 Step 4/9 : WORKDIR /project ---> Using cache ---> 4ba87d64456e Step 5/9 : COPY cheers.go . ---> Using cache ---> 486d7602dccf Step 6/9 : RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o cheers cheers.go ---> Running in b77dee3bd612 container b77dee3bd612319c299e077116fc68ccf7f166246f85138b0e1cc0e074c8cb2b encountered an error during CreateProcess: failure in a Windows system call: Unspecified error (0x80004005) [Event Detail: failed to run runc create/exec call for container b77dee3bd612319c299e077116fc68ccf7f166246f85138b0e1cc0e074c8cb2b: exit status 1 Stack Trace: github.com/Microsoft/opengcs/service/gcs/runtime/runc.(*container).startProcess /go/src/github.com/Microsoft/opengcs/service/gcs/runtime/runc/runc.go:580 github.com/Microsoft/opengcs/service/gcs/runtime/runc.(*runcRuntime).runCreateCommand /go/src/github.com/Microsoft/opengcs/service/gcs/runtime/runc/runc.go:471 github.com/Microsoft/opengcs/service/gcs/runtime/runc.(*runcRuntime).CreateContainer /go/src/github.com/Microsoft/opengcs/service/gcs/runtime/runc/runc.go:113 github.com/Microsoft/opengcs/service/gcs/core/gcs.(*gcsCore).ExecProcess /go/src/github.com/Microsoft/opengcs/service/gcs/core/gcs/gcs.go:351 github.com/Microsoft/opengcs/service/gcs/bridge.(*Bridge).execProcess /go/src/github.com/Microsoft/opengcs/service/gcs/bridge/bridge.go:637 github.com/Microsoft/opengcs/service/gcs/bridge.(*Bridge).execProcess-fm /go/src/github.com/Microsoft/opengcs/service/gcs/bridge/bridge.go:253 github.com/Microsoft/opengcs/service/gcs/bridge.HandlerFunc.ServeMsg /go/src/github.com/Microsoft/opengcs/service/gcs/bridge/bridge.go:72 github.com/Microsoft/opengcs/service/gcs/bridge.(*Mux).ServeMsg /go/src/github.com/Microsoft/opengcs/service/gcs/bridge/bridge.go:146 github.com/Microsoft/opengcs/service/gcs/bridge.(*Bridge).ListenAndServe.func2.1 /go/src/github.com/Microsoft/opengcs/service/gcs/bridge/bridge.go:335 runtime.goexit /usr/lib/go/src/runtime/asm_amd64.s:1333 Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandArgs":["/bin/sh","-c","CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags \"-static\"' -o cheers cheers.go"],"WorkingDirectory":"/project","Environment":{"GOLANG_VERSION":"1.11.13","GOPATH":"/go","HOSTNAME":"b77dee3bd612","PATH":"/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0],"OCISpecification":{"ociVersion":"1.0.1-dev","process":{"user":{"uid":0,"gid":0},"args":["/bin/sh","-c","CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags \"-static\"' -o cheers cheers.go"],"env":["PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","HOSTNAME=b77dee3bd612","GOLANG_VERSION=1.11.13","GOPATH=/go"],"cwd":"/project","capabilities":{"bounding":["CAP_CHOWN","CAP_DAC_OVERRIDE","CAP_FSETID","CAP_FOWNER","CAP_MKNOD","CAP_NET_RAW","CAP_SETGID","CAP_SETUID","CAP_SETFCAP","CAP_SETPCAP","CAP_NET_BIND_SERVICE","CAP_SYS_CHROOT","CAP_KILL","CAP_AUDIT_WRITE"],"effective":["CAP_CHOWN","CAP_DAC_OVERRIDE","CAP_FSETID","CAP_FOWNER","CAP_MKNOD","CAP_NET_RAW","CAP_SETGID","CAP_SETUID","CAP_SETFCAP","CAP_SETPCAP","CAP_NET_BIND_SERVICE","CAP_SYS_CHROOT","CAP_KILL","CAP_AUDIT_WRITE"],"inheritable":["CAP_CHOWN","CAP_DAC_OVERRIDE","CAP_FSETID","CAP_FOWNER","CAP_MKNOD","CAP_NET_RAW","CAP_SETGID","CAP_SETUID","CAP_SETFCAP","CAP_SETPCAP","CAP_NET_BIND_SERVICE","CAP_SYS_CHROOT","CAP_KILL","CAP_AUDIT_WRITE"],"permitted":["CAP_CHOWN","CAP_DAC_OVERRIDE","CAP_FSETID","CAP_FOWNER","CAP_MKNOD","CAP_NET_RAW","CAP_SETGID","CAP_SETUID","CAP_SETFCAP","CAP_SETPCAP","CAP_NET_BIND_SERVICE","CAP_SYS_CHROOT","CAP_KILL","CAP_AUDIT_WRITE"]}},"root":{"path":"rootfs"},"hostname":"b77dee3bd612","mounts":[{"destination":"/proc","type":"proc","source":"proc","options":["nosuid","noexec","nodev"]},{"destination":"/dev","type":"tmpfs","source":"tmpfs","options":["nosuid","strictatime","mode=755","size=65536k"]},{"destination":"/dev/pts","type":"devpts","source":"devpts","options":["nosuid","noexec","newinstance","ptmxmode=0666","mode=0620","gid=5"]},{"destination":"/sys","type":"sysfs","source":"sysfs","options":["nosuid","noexec","nodev","ro"]},{"destination":"/sys/fs/cgroup","type":"cgroup","source":"cgroup","options":["ro","nosuid","noexec","nodev"]},{"destination":"/dev/mqueue","type":"mqueue","source":"mqueue","options":["nosuid","noexec","nodev"]},{"destination":"/dev/shm","type":"tmpfs","source":"shm","options":["nosuid","noexec","nodev","mode=1777"]}],"linux":{"resources":{},"namespaces":[{"type":"mount"},{"type":"network"},{"type":"uts"},{"type":"pid"},{"type":"ipc"}],"maskedPaths":["/proc/asound","/proc/acpi","/proc/kcore","/proc/keys","/proc/latency_stats","/proc/timer_list","/proc/timer_stats","/proc/sched_debug","/proc/scsi","/sys/firmware"],"readonlyPaths":["/proc/bus","/proc/fs","/proc/irq","/proc/sys","/proc/sysrq-trigger"]},"windows":{"layerFolders":["C:\\ProgramData\\Docker\\lcow\\072ca1f3855a32f3e3b24c2fe4ca8dea9853d4fb64207407094332a2d6541458","C:\\ProgramData\\Docker\\lcow\\c45071b2eff55610a9d9b3f430b8e5fa3ff65465e59b8d5a63a61e744ca94c48","C:\\ProgramData\\Docker\\lcow\\6890c90396b8fcd14669837530eef071ec5e3f10dda6724478c7ab1b58752307","C:\\ProgramData\\Docker\\lcow\\a1998eef0068aac5fb61f53e87ce8d6d46eaf5c83f7eab36cb745fb57ad72e8a","C:\\ProgramData\\Docker\\lcow\\f311f4698a5c1eb5e8800ef04c6066177112d76afc18d089fcf2cd5642712a01","C:\\ProgramData\\Docker\\lcow\\5e7e640cace36a63707967e7109604dacc800b8163eb04a4be7f346ff38ba867","C:\\ProgramData\\Docker\\lcow\\a2a8b17328e92e236a3d30841abed7b815188a3d63e2432272f772acda4ec75d","C:\\ProgramData\\Docker\\lcow\\d774068efa88052dab131c32c40832302f547dd4737738ca19873e0c3bed0074","C:\\ProgramData\\Docker\\lcow\\b433fd6793fe572e509619d719280574a3b1860dbcc647ec6629695666227ca5","C:\\ProgramData\\Docker\\lcow\\b77dee3bd612319c299e077116fc68ccf7f166246f85138b0e1cc0e074c8cb2b"],"hyperv":{},"network":{"endpointList":["0FFBAC8D-5E31-4C4F-A753-85C5148C437D"],"allowUnqualifiedDNSQuery":true}}}} Any idea of how I should run my builds in docker ?
I encountered exactly the same error. I don' know if it comes from the fact that during installation I checked "only Windows containers", but it switched to Windows containers in Docker For Windows. So the solution is to click switch to Linux container, then I clean all : docker system prune Then I run again: docker build -t <user>/cheers2019 . Now it works for me. Here is my Docker version : docker version Client: Docker Engine - Community Version: 19.03.5 API version: 1.40 Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:22:37 2019 OS/Arch: windows/amd64 Experimental: true Server: Docker Engine - Community Engine: Version: 19.03.5 API version: 1.40 (minimum version 1.12) Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:29:19 2019 OS/Arch: linux/amd64 Experimental: true containerd: Version: v1.2.10 GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339 runc: Version: 1.0.0-rc8+dev GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 docker-init: Version: 0.18.0 GitCommit: fec3683
I have Trying to change the experimental. Check : Docker version in Console if experimental is false in both Client and Server. Then you can change in C:\Users\.docker in config.json you change experimental":"enabled" then in daemon.json you change "experimental": true then after save I run again. docker build -t <user>/cheers2019 .
On Windows 10 I was having the same problem reported in the current question and the following issue as well: NPM Install doesn't work in Docker. To solve the issue I've combined both solutions: #JPBlanc (Switch to Linux Containers) #Muhammad (disable experimental on command line & configuration file) How I did it: 1) Switch to Linux Containers: On taskbar, right click on docker icon and click on the option as presented bellow: 2) Disable "Experimental Features" on Command Line: Open docker/settings and click on Command Line: 3) Disable Experimental setting on configuration file:: On docker/settings, click on Docker Engine and certify that experimental is set to false: Hope it helps. Cheers
replace CRLF characters with LF for Windows in a tool like Notepad++ and rerun.