58083

Docker: Error processing tar file(exit status 1): Error setting up pivot dir: not a directory

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!

My Dockerfile:

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.

Answer1:

You forgot a / in /foo. In your configuration docker will put your pom.xml as /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.

Try:

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

Recommend

  • How to Use build-stability-plugin in sonar
  • Adding a system dependency to Maven
  • How to format MonetaryAmount with currency symbol?
  • App Engine: jar in WEB-INF/lib but still getting java.lang.ClassNotFoundException
  • How to import dependecies from build.gradle to pom.xml
  • Jersey linking support with Google App Engine issue
  • Wrap/Break list items in two ul
  • What is expected when I am told “Sort a singly linked list”
  • using gradle to deploy features.xml to nexus?
  • SpringBoot Couchbase Integration
  • How to consume and replace a value in an &mut ref [duplicate]
  • Docker: Error processing tar file(exit status 1): Error setting up pivot dir: not a directory
  • Which additional libraries are required for client compression?
  • Created a maven project using quickstart using intelliJ, didn't seem to generate any dir struct
  • Maven - Transitive dependencies are not resolved for artifact deployed on Artifactory
  • multi artifact id in one pom
  • Cannot find class org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguratio
  • How to run IntelliJ and Maven on OS X?
  • RichFaces 4 autocomplete is not showing suggestions
  • How to debug tests from a Maven build in Eclipse?
  • ClassNotFoundException: com.mysql.jdbc.Driver not found while using service mix
  • Could not find goal '' in plugin org.springframework.boot:spring-boot-maven-plugin:1.1.4.R
  • Install ActiveMq in Apache Karaf 4.0.0.M2
  • Grails 3 - How to publish to Artifactory
  • Maven use Encrypted passwords in POM
  • “mvn clean generate-source” could not resolve dependencies
  • How to view images from protected folder with php?
  • Display images in Django
  • Spark fat jar to run multiple versions on YARN
  • Jetty Server not starting: Unable to establish loopback connection
  • The plugin 'org.apache.maven.plugins:maven-jboss-as-plugin' does not exist or no valid ver
  • Resize panoramic image to fixed size
  • Deserializing XML into class C#
  • Importing jscolor library in angular 2
  • Is there a mandatory requirement to switch app.yaml?
  • Acquiring multiple attributes from .xml file in c#
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How can I remove ASP.NET Designer.cs files?
  • How to Embed XSL into XML
  • java string with new operator and a literal