COPY failed: stat /var/lib/docker/overlay2/.../merged/app/target/dependency/BOOT-INF/lib: no such file or directory
Expected behavior
Docker build succeeds.
Actual behavior
Docker build crashes at the command:
I successfully built my docker images as usual. But after some different acts (installing some npm packages like yarn, resetting the git branch, editing .gitignore files), the build crashes at the command
COPY --from=maven ${DEPENDENCY}/BOOT-INF/lib /app/lib
with the following message:
Step 11/14 : COPY --from=maven ${DEPENDENCY}/BOOT-INF/lib /app/lib
ERROR: Service 'backend-service' failed to build: COPY failed: stat /var/lib/docker/overlay2/3d2bec4b61db8408/merged/app/target/dependency/BOOT-INF/lib: no such file or directory
I reinstalled docker etc. I've even reset my computer, but this behaviour occoured again: First some successful builts but after some changes somewhere else the build crashes again. I restarted docker, did a git reset etc. but still.
Information
- Running Docker 2.1.0.5 on Windows
- Diagnostics ID: BAF1665A-5A4C-4264-92EE-0DF3BDD02A92/20200105203217
- Dockerfile crashing at command 11:
WORKDIR /app
COPY ./pom.xml .
RUN mvn dependency:go-offline -B
COPY ./src ./src
RUN mvn package -DskipTests=true
WORKDIR /app/target/dependency
RUN jar -xf ../build.jar
FROM adoptopenjdk/openjdk8-openj9:latest
ARG DEPENDENCY=/app/target/dependency
COPY --from=maven ${DEPENDENCY}/BOOT-INF/lib /app/lib
.....
Steps to reproduce the behavior
Run docker-compose -f docker-compose-dev.yml up --build
I hope somebody has an idea. Thanks a lot in advance. Best
An error with dependencies
Hello, how did you solve it, i have the same problem
This may be because you don't have enough free RAM to run the script, at least this was the cause for me when I was building on a server with 1Gb, but this depends a lot on what you're building.
Also after freeing some memory up, if that is the problem with you, make sure to build without using cache by adding --no-cache
docker-compose -f docker-compose-dev.yml --no-cache build
Even if you had enough free RAM when you tried the first time, you can try the above command.
Thanks, but it is already solved. The error was at another point: The Docker build for that java application crashed because a colleague removed a maven dependency. Nothing wrong with Docker or anything. Just a “little” mistake in the dependencies
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked