Extract artifact from built docker image (OD-2193)
Merlin Westphal opened 1 year ago

Hello there, I have a Java project where a jarfile is built using a Dockerfile and want this file to be published as an artifact, but I cannot figure out, how to extract it from the image.

What I've tried:

The built file lands in the directory /app/build/app.jar (inside of the built docker image). In my ci-spec I also set the image output to OCI-Layout and the output directory to "docker-image".

I assumed, the image data would now be accessible in docker-image/app/build/app.jar but I think I got something wrong here.

Is what I'm trying even possible or do I have to use a shell executor for this kind of task? Thanks in advance, any help is appreciated.

  • Robin Shen commented 1 year ago

    I think docker image encapsulates files in its own format, and it is not easy to extract them out. I think the easiest approach would be to get file before building the image.

  • Robin Shen changed state to 'Closed' 1 year ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2193
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover