Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker - no such file or directory

I'm receiving an error from docker when I run my docker file. It's saying the /var/lib/docker/aufs/layers/xxxx: no such file or directory when I run Docker build .

I have tried numerous ways to remove containers and images so I'm pretty much stock on this one.

Any

The Docker file is:

FROM node:6

RUN git clone https://github.com/preboot/angular2-webpack.git

WORKDIR angular2-webpack

RUN sed -i.bak 's/--port 8080/--host 0.0.0.0 --port 8080/'
package.json RUN npm i

CMD [ "npm", "run", "start" ]

The complete console output is:

Sending build context to Docker daemon
9.728 kB
Step 1 : FROM node:6
6: Pulling from library/node
6a5a5368e0c2: Already exists
7b9457ec39de: Already exists
ff18e19c2db4: Already exists
6a3d69edbe90: Already exists
0ce4b037e17f: Already exists
82252a100d5a: Already exists
Digest:
sha256:db245bde5445eb122d8dc090ba98539a9ef7f56c0ea981ade643695af0d8eaf0
Status: Downloaded newer image for node:6
---> 9873603dc506 Step 2 :
RUN git clone https://github.com/preboot/angular2-webpack.git open
/var/lib/docker/aufs/layers/9319fd93cb6d6718243ff2e65ce5d2aa6122a1bb9211aa9f8e88d85c298727e5:
no such file or directory User:docker-test 

Edit

The issue was resolved thanks to @BMitchs' recommendation:

  1. rm -rf /var/lib/docker/*
  2. Uninstall Docker completely
  3. re install docker
like image 702
Jimi Avatar asked Oct 08 '16 23:10

Jimi


People also ask

How do I make docker without cache?

You can rebuild the image from the base image without using cached layers by using the --no-cache option. New layers were constructed and used. The docker build runs both commands this time, which comes with an all-or-nothing approach.

What is Workdir in Dockerfile?

The WORKDIR command is used to define the working directory of a Docker container at any given time. The command is specified in the Dockerfile. Any RUN , CMD , ADD , COPY , or ENTRYPOINT command will be executed in the specified working directory.

What should be in Dockerignore?

Usually, you put the Dockerfile in the root directory of your project, but there may be many files in the root directory that are not related to the Docker image or that you do not want to include. . dockerignore is used to specify such unwanted files and not include them in the Docker image.

Where is .dockerignore file located?

.dockerignore file. Before the docker CLI sends the context to the docker daemon, it looks for a file named .dockerignore in the root directory of the context.


3 Answers

With that sort of corruption, I'd give a full docker wipe a try, rm -rf /var/lib/docker/*. Before doing that, backup any data (volumes), then shutdown docker, and you'll need to pull or rebuild all your images again. If there are still problems with aufs, try changing the filesystem driver, e.g. changing to dockerd -s overlay2 in your service startup.

It doesn't hurt to check for common issues, like running out of disk space or old version of the application, first.

like image 51
BMitch Avatar answered Nov 17 '22 05:11

BMitch


try building the image again on a clean machine or using the --no-cache flag, this seems like a caching issue.

Also - In my company, we clone the code into the machine building the image, and then copy the code into the container. In my opinion - it's a better solution, but I think it's a matter of taste.

like image 29
Yaron Idan Avatar answered Nov 17 '22 03:11

Yaron Idan


The data files used by Docker are corrupted. You can execute the following command:

1- If they exist, delete contain and image

docker rm CONTAINER ID
docker rmi IMAGE ID

2- Stop the Docker service (Ubuntu)

service docker stop

3- Start the Docker service (Ubuntu)

service docker start

4- Check Docker service status (Ubuntu)

service docker status
like image 2
Jonathan Mendoza Avatar answered Nov 17 '22 04:11

Jonathan Mendoza