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

/project dir unmodifiable #167

Closed
crionuke opened this issue Aug 31, 2021 · 7 comments · Fixed by quarkusio/quarkus#19988
Closed

/project dir unmodifiable #167

crionuke opened this issue Aug 31, 2021 · 7 comments · Fixed by quarkusio/quarkus#19988

Comments

@crionuke
Copy link

crionuke commented Aug 31, 2021

Hi, there
When used Dockerfile to multistage build from here got next error:

Step 12/16 : COPY --from=build /project/target/*-runner /work/application
COPY failed: no source files were specified

Think that /project unmodifiable so any changes by RUN ./mvnw -s package just cleared

There is properly Dockerfile for that?

Client: Docker Engine - Community
 Cloud integration: 1.0.7
 Version:           20.10.2
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        2291f61
 Built:             Mon Dec 28 16:12:42 2020
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.2
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8891c58
  Built:            Mon Dec 28 16:15:28 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
@cescoffier
Copy link
Member

Already fixed: https://quarkus.io/version/main/guides/building-native-image#multistage-docker.

/projects is a volume, it should not be used for sharing content between stages. The fun fact is that it works on Mac, but does not work on Linux.

@crionuke
Copy link
Author

@cescoffier
Nice, thanks a lot!

But made some fixes to prevent permissions problems with target dir

COPY --chown=quarkus:quarkus mvnw /code/mvnw
COPY --chown=quarkus:quarkus .mvn /code/.mvn
COPY --chown=quarkus:quarkus pom.xml /code/
COPY --chown=quarkus:quarkus settings.xml /code/

@cescoffier
Copy link
Member

Do you mean that even with the new one you have permission issues?

@crionuke
Copy link
Author

yep, like this - Quarkus code generation phase has failed: Failed to create the output dir /code/target/classes
because ./mvnw package works under quarkus user, but code dir created under root from base image

simple docker file to reproduce

FROM quay.io/quarkus/ubi-quarkus-native-image:21.1.0-java11 AS build
COPY pom.xml /code/
USER quarkus
WORKDIR /code
RUN mkdir target # simulate mvn package to target dir

@cescoffier
Copy link
Member

Except that: this pipeline works for me... so it definitely platform specific. I need to test with your permissions to see if that still works.

@cescoffier
Copy link
Member

Ok, this is really weird, because it seems that now I need the same permission changes....

cescoffier added a commit to cescoffier/quarkus that referenced this issue Sep 8, 2021
…the right permissions.

Fix quarkusio/quarkus-images#167

It was not required until recent docker versions (on Mac, it seems to have been required on Linux). Setting permissions works for both older and new Docker versions.
@cescoffier
Copy link
Member

Opened quarkusio/quarkus#19988.

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 a pull request may close this issue.

2 participants