Coder Social home page Coder Social logo

Issue building docker image about my-project HOT 6 OPEN

ajaufura avatar ajaufura commented on June 30, 2024
Issue building docker image

from my-project.

Comments (6)

mhmdahmed167 avatar mhmdahmed167 commented on June 30, 2024 4

Hello,

I have folk your repo and i'm having this issue on building the docker image:

Step 3/5 : COPY ./build/libs/my-app-1.0-SNAPSHOT.jar /usr/app/ COPY failed: file not found in build context or excluded by .dockerignore: stat build/libs/my-app-1.0-SNAPSHOT.jar: file does not exist Error: Command failed: docker build -f Dockerfile -t docker.io/***/myrepo/demo-app:master-27211ac .

Do you have an idea of the missing .jar file ? Thanks.

Got the solution:
If you open the Dockerfile and checkout the components in COPY and ENTRYPOINT, the project name will be "my-app-1.0-SNAPSHOT.jar" just change it to "java-app-1.0-SNAPSHOT.jar"
It should run smoothly after that

from my-project.

maulanaakbardj avatar maulanaakbardj commented on June 30, 2024 1

solution: open dockerfile and replace
COPY ./build/libs/my-app-1.0-SNAPSHOT.jar /usr/app/
with
COPY ./build/libs/java-app-1.0-SNAPSHOT.jar /usr/app/
and
ENTRYPOINT ["java", "-jar", "my-app-1.0-SNAPSHOT.jar"]
with
ENTRYPOINT["java", "-jar", "java-app-1.0-SNAPSHOT.jar"]

make sure you have a build folder like in the new-ci-workflow branch this folder contains jar files

from my-project.

kanishksha avatar kanishksha commented on June 30, 2024

i also havin same problem...

from my-project.

akashgoyal89 avatar akashgoyal89 commented on June 30, 2024

@mhmdahmed167 your solution works...how did you reached this solution?...where did you check?

from my-project.

mhmdahmed167 avatar mhmdahmed167 commented on June 30, 2024

from my-project.

matthewfischl avatar matthewfischl commented on June 30, 2024

@maulanaakbardj and @mhmdahmed167 : The solution works, but a following step fails with the below message;

Error: Unsupported GitHub event - only supports push https://help.github.com/en/articles/events-that-trigger-workflows#push-event-push

Does this mean that we can't build the docker image as part of the pull request? I.e., we can only build the docker image when pushing to main?

UPDATE: In the dockerfile, changing:

uses: mr-smithers-excellent/docker-build-push@v4

to

uses: mr-smithers-excellent/docker-build-push@v6

This resolves the issue

from my-project.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.