-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12762 from glefloch/fix/12706
- Loading branch information
Showing
5 changed files
with
79 additions
and
103 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
...resources/codestarts/quarkus/core/tooling/dockerfiles/base/Dockerfile-layout.include.qute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#### | ||
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode | ||
# | ||
# Before building the container image run: | ||
# | ||
# {#insert quarkusbuild} mvn package {/} | ||
# | ||
# Then, build the image with: | ||
# | ||
# docker build -f src/main/docker/Dockerfile.{type} -t quarkus/{project.artifact-id}-{type} . | ||
# | ||
# Then run the container using: | ||
# | ||
# docker run -i --rm -p 8080:8080 quarkus/{project.artifact-id}-{type} | ||
# | ||
# If you want to include the debug port into your docker image | ||
# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5050 | ||
# | ||
# Then run the container using : | ||
# | ||
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/{project.artifact-id}-{type} | ||
# | ||
### | ||
FROM {#insert image /} | ||
{#insert args /} | ||
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 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" | ||
{#insert copy /} | ||
|
||
EXPOSE 8080 | ||
USER 1001 | ||
|
||
ENTRYPOINT [ "/deployments/run-java.sh" ] |
57 changes: 8 additions & 49 deletions
57
...starts/quarkus/core/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.fast-jar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,16 @@ | ||
#### | ||
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode | ||
# | ||
# Before building the container image run: | ||
# | ||
# mvn package -Dquarkus.package.type=fast-jar | ||
# | ||
# Then, build the image with: | ||
# | ||
# docker build -f src/main/docker/Dockerfile.fast-jar -t quarkus/{project.artifact-id}-fast-jar . | ||
# | ||
# Then run the container using: | ||
# | ||
# docker run -i --rm -p 8080:8080 quarkus/{project.artifact-id}-fast-jar | ||
# | ||
# If you want to include the debug port into your docker image | ||
# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5050 | ||
# | ||
# Then run the container using : | ||
# | ||
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/{project.artifact-id}-fast-jar | ||
# | ||
### | ||
FROM {dockerfile.fast-jar.from} | ||
|
||
{#include Dockerfile-layout type='fast-jar'} | ||
{#quarkusbuild}mvn package -Pquarkus.package.type=fast-jar{/quarkusbuild} | ||
{#image}{dockerfile.fast-jar.from} {/image} | ||
{#args} | ||
ARG JAVA_PACKAGE={dockerfile.fast-jar.java-package} | ||
ARG RUN_JAVA_VERSION={dockerfile.fast-jar.run-java-version} | ||
|
||
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 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" | ||
|
||
{/args} | ||
{#copy} | ||
# We make four distinct layers so if there are application changes the library layers can be re-used | ||
COPY --chown=1001 {buildtool.build-dir}/quarkus-app/lib/ /deployments/lib/ | ||
COPY --chown=1001 {buildtool.build-dir}/quarkus-app/*.jar /deployments/ | ||
COPY --chown=1001 {buildtool.build-dir}/quarkus-app/app/ /deployments/app/ | ||
COPY --chown=1001 {buildtool.build-dir}/quarkus-app/quarkus/ /deployments/quarkus/ | ||
{/copy} | ||
{/include} | ||
|
||
EXPOSE 8080 | ||
USER 1001 | ||
|
||
ENTRYPOINT [ "/deployments/run-java.sh" ] |
57 changes: 7 additions & 50 deletions
57
.../codestarts/quarkus/core/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.jvm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,11 @@ | ||
#### | ||
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode | ||
# | ||
# Before building the container image run: | ||
# | ||
# mvn package | ||
# | ||
# Then, build the image with: | ||
# | ||
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/{project.artifact-id}-jvm . | ||
# | ||
# Then run the container using: | ||
# | ||
# docker run -i --rm -p 8080:8080 quarkus/{project.artifact-id}-jvm | ||
# | ||
# If you want to include the debug port into your docker image | ||
# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5050 | ||
# | ||
# Then run the container using : | ||
# | ||
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/{project.artifact-id}-jvm | ||
# | ||
### | ||
FROM {dockerfile.jvm.from} | ||
|
||
{#include Dockerfile-layout type='jvm'} | ||
{#image}{dockerfile.jvm.from} {/} | ||
{#args} | ||
ARG JAVA_PACKAGE={dockerfile.jvm.java-package} | ||
ARG RUN_JAVA_VERSION={dockerfile.jvm.run-java-version} | ||
|
||
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 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" | ||
|
||
{/args} | ||
{#copy} | ||
COPY {buildtool.build-dir}/lib/* /deployments/lib/ | ||
COPY {buildtool.build-dir}/*-runner.jar /deployments/app.jar | ||
|
||
EXPOSE 8080 | ||
USER 1001 | ||
|
||
ENTRYPOINT [ "/deployments/run-java.sh" ] | ||
{/copy} | ||
{/include} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters