Docker build Error checking context: 'can not stat' \\? \ C: \ Users \ username \ AppData \ Local \ Application Data ''

Docker build error in Windows 10,

After successfully installing dockers, creating an image of dockers using the command below.

docker build -t drtuts: last. Facing below. enter image description here

Please let me know if someone has resolved the same issue.

+10
source share
9 answers

Just create a new directory and enter it:

$ mkdir dockerfiles $ cd dockerfiles 

Create your file in this directory:

 $ touch Dockerfile 

Edit it and add commands using vi :

 $ vi Dockerfile 

Finally run:

 $ docker build -t tag . 
+20
source

I also received the same error message in Windows 10 Home.

I resolved it with the following steps:

  • Create a directory called "dockerfiles" under C: \ Users \ (username)
  • Save the {dockerfile without any extension} under the newly created directory, as indicated in step (1).

Now run the command {from the directory C: \ Users \ (username)}: docker build -t./dockerfiles

He worked like the wind!

+3
source

Docker grants read and write permissions only to the owner of the file, and sometimes an error occurs if the user trying to create the application is different from the owner.

You can create a Docker group and add users there. in Debian will look like this

sudo groupadd docker

sudo usermod -aG docker $USER

+2
source

Here are my steps on Windows 10 that worked. Open a command prompt as administrator:

 cd c:\users\ashok\Documents mkdir dockerfiles cd dockerfiles touch dockerfile notepad dockerfile # Write/paste here the contents of dockerfile docker build -t jupyternotebook -f dockerfile . 
+2
source

Due to a resolution issue, this issue has occurred.

I recommend checking the permission of a respected user, which is available in the Dockerfile.

Nothing wrong in any way.

0
source

I encountered a similar situation in Windows 10 and was able to solve it using the following approach:

  1. Change to the directory where your Dockerfile is stored from your CLI (I used PowerShell).
  2. Run the docker build .

It looks like you are using the bash shell on Windows 10, when I tried to use it, docker was not even recognized as a command (can be checked with docker --version ).

0
source

On windows 10

  • Open command line
  • C: \ Users \ User>
  • mkdir dockerfiles
  • cd dockerfiles
  • Notepad Dockerfile.txt

// after notepad opens, enter your docker commands and save the Dockerfile. Let's go back to the command line like "python-hello-world", for example.

  • building the docker image -t python-hello-world -f./Dockerfile.txt.
0
source

I write, as it will be useful to people who play with apparmor

I also got this problem on my Ubuntu machine. This happened because I ran the aa-genprof docker command to scan the docker command to create the apparmor profile. Therefore, the scanned process created the file usr.bin.docker in the directory /etc/apparmor.d , which added some permissions for the docker command. Thus, after deleting this file and rebooting, the Docker machine works fine again.

0
source

For Linux Ubuntu, try sudo docker build .

0
source

Source: https://habr.com/ru/post/1261725/


All Articles