I am trying to build a Docker Image from a simple Spring RESTful web service jar.
For that I have specified the following Dockerfile:
FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE ADD ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] I am trying to "Build a Docker Image with Maven" from my IDEA cli like stated in the instructions here
./mvnw install dockerfile:build Unfortunately this throws an exception:
Could not build image: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: Permission denied Since I don't know how to solve this I tried to build an image from the terminal with docker command:
$ docker build nordic/demo Which created the image but with name and tag as <none>. Read about it from docker documentations but nothing said about that.
I am new to Docker so im sure there is some fundamental misunderstanding in how to build the Docker Image. Mainly:
- When building from terminal how does Docker know how to name the Image?
- When building with spotify plugin, why/what permissions are required to use the plugin (logging in to dockerhub before the build didn't help)?
Thanks for any pointers or explanations!