d067110103
CI / Build Native (push) Failing after 8m52s
The .dockerignore has 'target' which excludes the target/
directory from the docker build context. The Dockerfile was
COPYing the binary from target/, so docker build failed with
'file not found in build context or excluded by .dockerignore'.
Fix: copy the binary to build-output/ (a non-excluded path)
before docker build, and update the Dockerfile to copy from
build-output/.
- Add 'Stage binary for Docker' step that does:
mkdir -p build-output
cp target/shot-crafter-calculator-1.0.0-runner build-output/
- Dockerfile COPY now reads build-output/shot-crafter-calculator-1.0.0-runner
- build-output/ is not in .dockerignore -> only the binary
(~117MB) ships in the build context, not the whole target/
tree (~200MB with classes, generated-sources, node binaries, etc.)
13 lines
356 B
Docker
13 lines
356 B
Docker
FROM quay.io/quarkus/quarkus-micro-image:2.0
|
|
WORKDIR /work/
|
|
COPY build-output/shot-crafter-calculator-1.0.0-runner /work/application
|
|
|
|
RUN chmod 775 /work /work/application \
|
|
&& chown -R 1001 /work \
|
|
&& echo "securerandom.source=file:/dev/urandom" >> /work/application
|
|
|
|
EXPOSE 8080
|
|
USER 1001
|
|
|
|
ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
|