user1474111
user1474111

Reputation: 1516

Unable to find image 8080:8080 locally

I am new in docker and created a simple springboot hello world application. I created a dockerfile according to the tutorials and build it by docker.

FROM adoptopenjdk/openjdk11-openj9:jdk-11.0.1.13-alpine-slim
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} myapp-1.0.0.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom", "-jar","/myapp-1.0.0.jar"]

EDIT: using -p gives another error which is Invalid or corrupt jarfile /myapp-1.0.0.jar

After that I tried to run the docker on my local machine. But I am getting an error which says unable to find image 8080:8080 locally.

docker run 8080:8080 --name myhelloimage myuser/myhelloimage:latest

I am able to see docker image by docker images

REPOSITORY                           TAG                         IMAGE ID            CREATED             SIZE
myuser/myhelloimage              latest                      c5dfe18b0fb3        14 minutes ago      271MB

So what is wrong here why I am getting an error?

Upvotes: 0

Views: 954

Answers (1)

robsiemb
robsiemb

Reputation: 6364

You didn't include the -p before 8080:8080, so the docker command is interpreting it as an image not a port mapping. You can see the full documentation here.

Upvotes: 1

Related Questions