简体   繁体   中英

I can't launch my API through the docker image

I downloaded a docker image of an API made in java that I hosted on the docker hub:

docker pull claubermartins/back-crud-spring:2.0

When I created the container and I try to run the API, I got the following warning after the code:

docker run claubermartins/back-crud-spring: 2.0

"Error: Unable to access jarfile backCrudSpring.jar"

The Dockerfile used to build the image:

FROM adoptopenjdk/openjdk11:alpine-jre
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} backCrudSpring.jar
ENTRYPOINT ["java","-jar","backCrudSpring.jar"]

After the suggestions I typed the code docker run --entrypoint ls --rm claubermartins/back-crud-spring:2.0 and verified that the name of the .jar file was wrong.

To confirm I generated a new image and uploaded it to the docker hub docker build -t claubermartins/back-crud-spring:3.0 . and it works perfectly with the command docker run claubermartins/back-crud-spring:3.0 .

Concluding as soon as I uploaded the image with a different Dockerfile to the Hub.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM