quarkusio / quarkus-quickstarts

Quarkus quickstart code
https://quarkus.io
Apache License 2.0
1.95k stars 1.46k forks source link

Error on dockerfile build deploying on openshift #587

Open caiomcoliveira opened 4 years ago

caiomcoliveira commented 4 years ago

Hello, I tried deploying my quarkus application to openshift, howerver, I get an error on the COPY command "COPY target/lib/* /deployments/lib/"

It doens't locate the directory:

STEP 7: COPY target/lib/* /deployments/lib/ error: build error: error building at STEP "COPY target/lib/* /deployments/lib/": no files found matching "/tmp/build/inputs/backend/target/lib/*": no such file or directory

I've tried different Dockerfiles, and followed a youtube tutorial step by step, but get the same error. (https://www.youtube.com/watch?v=QxJQMb35RWU)

Could it be because I am using a lab enviroment from a online course from redhat?

My DockerFile.jvm


FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1

ARG JAVA_PACKAGE=java-1.8.0-openjdk-headless
ARG RUN_JAVA_VERSION=1.3.5

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'

# Install java and the run-java script
# Also set up permissions for user `1001`
RUN microdnf install openssl curl ca-certificates ${JAVA_PACKAGE} \
    && microdnf update \
    && microdnf clean all \
    && mkdir /deployments \
    && chown 1001 /deployments \
    && chmod "g+rwX" /deployments \
    && chown 1001:root /deployments \
    && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
    && chown 1001 /deployments/run-java.sh \
    && chmod 540 /deployments/run-java.sh \
    && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security

# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"

COPY target/lib/* /deployments/lib/
COPY target/*-runner.jar /deployments/app.jar

EXPOSE 8080
USER 1001

ENTRYPOINT [ "/deployments/run-java.sh" ]

Could anyone help me?

gsmet commented 4 years ago

Are you building from the root of your Quarkus application directory? Did you build your Quarkus application?

Because target/lib should for sure be created.

caiomcoliveira commented 4 years ago

Building the app beforehand does work. But I was wondering if there was any way to deploy it without needing a machine that has JDK