I am new to Docker, and don't know what is causing this error or how to diagnose it. Any specific help with this problem or tips on where to check first to diagnose this type of problem would be much appreciated!
FROM java:8 # Install maven RUN apt-get update RUN apt-get -y install maven # Build foo ENV curr /foo WORKDIR $curr ADD $curr/pom.xml /code/$curr ADD $curr/src /code/$curr RUN mvn package
When I try to build it with "docker build .":
... Step 7 : ADD $curr/src /code/$curr Error processing tar file(exit status 1): Error setting up pivot dir: mkdir /var/lib/docker/devicemapper/mnt/236c9a1ac7edbd177f4718286f530cbba4ca275ec881be1e8fa3168e572843ac/rootfs/code/foo/.pivot_root774820419: not a directory
From what I understand, mkdir prints this when it tries to create a directory, but a file, symlink or socket by the same name already exists. But this seems to be some step internal to Docker, and changing the debug level didn't produce any useful output.
You forgot a
/foo. In your configuration docker will put your
/code/foo rather than, what I guess you intended,
/code/foo/pom.xml. It then tries to add your source to your 'pom.xml' file which gives this error.
FROM java:8 # Install maven RUN apt-get update RUN apt-get -y install maven # Build foo ENV curr /foo/ # <-- missing / WORKDIR $curr ADD $curr/pom.xml /code/$curr ADD $curr/src /code/$curr RUN mvn package