-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify fast jar dockerfiles by only using a single copy command. #10634
Simplify fast jar dockerfiles by only using a single copy command. #10634
Conversation
COPY --chown=1001 ${build_dir}/quarkus-app/*.jar /deployments/ | ||
COPY --chown=1001 ${build_dir}/quarkus-app/app/ /deployments/app/ | ||
COPY --chown=1001 ${build_dir}/quarkus-app/quarkus/ /deployments/quarkus/ | ||
COPY --chown=1001 ${build_dir}/quarkus-app /deployments/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it equivalent? I would expect this to copy the quarkus-app
directory inside /deployments/
whereas we used to copy the content of this directory, meaning the main jar was at the root of /deployments/
.
At least if Docker's COPY
has the same semantic as cp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it locally by adding a RUN ls /deployments
line after that and the log shows that the contents of the directory have been copied:
Step 13/17 : COPY --from=builder --chown=1001 /usr/src/app/bff/build/quarkus-app /deployments/
---> Using cache
---> 61e79dc8db06
Step 14/17 : RUN ls /deployments
---> Running in 5124e52a774d
app
lib
quarkus
quarkus-run.jar
run-java.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. That's a bit weird IMO but not familiar with Docker so I trust you :).
That being said, I'm wondering if we could change that to:
COPY --chown=1001 ${build_dir}/quarkus-app/* /deployments/
to be on the safe side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this seems to unpack the directories in the quarkus-app directory. The ls
now shows
app-1.0.0-SNAPSHOT.jar
boot
generated-bytecode.jar
main
quarkus-application.dat
quarkus-run.jar
run-java.sh
transformed-bytecode.jar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gsmet: In the docker copy docs, I just found a note saying the following about the src path:
The directory itself is not copied, just its contents.
Furthermore, the pattern matching seems to the one Golang uses. Therefore I think it doesn't apply the standard linux semantics.
@gsmet: Is there anything more you need for this? |
Yes, let's merge it thanks! Sorry for wasting your time with my questions :). |
Better safe than sorry! :) |
This is now no longer layered, so even if you just change one thing in your app you need to re-ship all the libraries. |
Use only a single COPY command in the fast jar dockerfile templates.