Skip to content
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

Change ownership of the project volume mount directory to the quarkus user #128

Merged
merged 1 commit into from
Jan 27, 2021
Merged

Change ownership of the project volume mount directory to the quarkus user #128

merged 1 commit into from
Jan 27, 2021

Conversation

jonathan-meier
Copy link
Contributor

Container builds for a native images on a remote docker host are currently not possible (quarkusio/quarkus#1610). The issue is that the native build step mounts a volume to the build container containing the sources for the native image build and to which the final native image is written back to the host. However, volume mounts are not available for remote docker daemons. Still, using remote docker daemons is a pretty common scenario.

I outlined a solution to this problem in a comment on the above mentioned issue quarkusio/quarkus#1610 (comment), which is to copy the build sources into the container as well as copy the final native image out of the container back to the host, instead of using the volume mount. PR quarkusio/quarkus#14635 implements this strategy, which used to work with the build images provided on quay.io some time ago (late August, I think), but does not work with the newest images anymore. It seems to be a permission issue with the /project mount point. It is created with the root user when building the docker image, but written to using the quarkus user (uid 1001) when building the native image, which fails. The native image builds only work, when an actual directory on the host is mounted as a volume using the z-flag. The z-flag unfortunately does not work for anonymous or named volumes.

The solution provided in this PR is to explicitly create the /project folder during the docker image build and let it be owned by the quarkus user (created in the add-quarkus-user module) before the volume is created on it.

@cescoffier
Copy link
Member

LGTM, @zakkak what do you think?

Copy link
Collaborator

@zakkak zakkak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well. Thanks @jonathan-meier

Tested with podman v2.2.1, mandrel 20.3.0.0.Final, and Quarkus 1.11.0.Final.

@cescoffier cescoffier merged commit 3de7510 into quarkusio:master Jan 27, 2021
@jonathan-meier
Copy link
Contributor Author

Awesome, thanks for the prompt reviews! The new images on quay.io work as expected now 👍

@jonathan-meier jonathan-meier deleted the project_dir_ownership branch January 28, 2021 12:30
matthyx pushed a commit to matthyx/quarkus-images that referenced this pull request Sep 20, 2021
Bug 1832629: Add metrics for 1xx, 3xx, and 4xx request counters, add latency, track reused connections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants