I’m new to docker. I’m wondering what is the wrong here? this is a basic react-project that i wanted to build a docker image from it according to a tutorial that i follow.
DockerFile
FROM node:14.16-alpine3.13
COPY . /app
I got this error when i enter this command docker build -t react-app .
$ docker build -t react-app .
[+] Building 9.4s (6/7)
=> [internal] load build definition from Dockerfile 1.7s
=> => transferring dockerfile: 31B 0.8s
=> [internal] load .dockerignore 2.0s
=> => transferring context: 2B 0.7s
=> [internal] load metadata for docker.io/library/node:14.16-alpine3.13 5.3s
=> [auth] library/node:pull token for registry-1.docker.io 0.0s
=> ERROR [internal] load build context 2.3s
=> => transferring context: 309.99kB 2.1s
=> [1/2] FROM docker.io/library/node:14.16-alpine3.13@sha256:7021600941a 0.0s
------
> [internal] load build context:
------
error from sender: open node_modules@babelplugin-bugfix-safari-id-destructurin
g-collision-in-function-expressionlib: Access is denied.
My docker version
$ docker version
Client:
Cloud integration: v1.0.22
Version: 20.10.12
API version: 1.41
Go version: go1.16.12
Git commit: e91ed57
Built: Mon Dec 13 11:44:07 2021
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.5.1 (74721)
Engine:
Version: 20.10.12
API version: 1.41 (minimum version 1.12)
Go version: go1.16.12
Git commit: 459d0df
Built: Mon Dec 13 11:43:56 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.12
GitCommit: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
!Important: I changed FROM node:alpine3.13
to FROM node:14.16-alpine3.13
after posting this question.
3
Answers
Change
To
that work in my case
I have the same problem. After sign in (logging) at Docker Desktop, the problem was gone.
Before sign in
After sign in
Same issue, but I made a bandaid with:
The problem was really me being too fast and loose with docker volumes which caused some of the files/directories in the directory with Dockerfile to be owned by root instead of "me".
The permanent fix for me is presumably to stop playing fast and loose with volume mounts.