Skip to content

Commit

Permalink
测试docker打包
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Dec 12, 2023
1 parent 8ad235f commit b51fd5b
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 273 deletions.
27 changes: 0 additions & 27 deletions nop-auth/nop-auth-app/src/main/docker/Dockerfile.native

This file was deleted.

30 changes: 0 additions & 30 deletions nop-auth/nop-auth-app/src/main/docker/Dockerfile.native-micro

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
####
<c:unit xpl:outputMode="text"><![CDATA[####
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
#
# Before building the container image run:
Expand All @@ -7,11 +7,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/code-with-quarkus-jvm .
# docker build . -f=src/main/docker/Dockerfile.jvm -t=nop/${appName}-app
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus-jvm
# docker run -i --rm -p 8080:8080 nop/${appName}-app
#
# If you want to include the debug port into your docker image
# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
Expand All @@ -20,7 +20,7 @@
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus-jvm
# docker run -i --rm -p 8080:8080 nop/${appName}-app
#
# This image uses the `run-java.sh` script to run the application.
# This scripts computes the command line to execute your Java application, and
Expand Down Expand Up @@ -95,3 +95,4 @@ ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"

ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]

]]></c:unit>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
####
<c:unit xpl:outputMode="text"><![CDATA[####
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
#
# Before building the container image run:
Expand All @@ -7,11 +7,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/code-with-quarkus-legacy-jar .
# docker build . -f=src/main/docker/Dockerfile.legacy-jar -t=nop/${appName}-app .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus-legacy-jar
# docker run -i --rm -p 8080:8080 nop/${appName}-app
#
# If you want to include the debug port into your docker image
# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
Expand All @@ -20,7 +20,7 @@
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus-legacy-jar
# docker run -i --rm -p 8080:8080 nop/${appName}-app
#
# This image uses the `run-java.sh` script to run the application.
# This scripts computes the command line to execute your Java application, and
Expand Down Expand Up @@ -91,3 +91,4 @@ ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"

ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]
]]></c:unit>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
####
<c:unit xpl:outputMode="text"><![CDATA[####
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
# It uses a micro base image, tuned for Quarkus native executables.
# It reduces the size of the resulting container image.
Expand All @@ -10,11 +10,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native-micro -t nop/nop-quarkus-demo .
# docker build . -f=src/main/docker/Dockerfile.native-micro -t=nop/${appName}-app .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 nop/nop-quarkus-demo
# docker run -i --rm -p 8080:8080 nop/${appName}-app
#
###
FROM quay.io/quarkus/quarkus-micro-image:2.0
Expand All @@ -28,3 +28,4 @@ EXPOSE 8080
USER 1001

ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
]]></c:unit>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
####
<c:unit xpl:outputMode="text"><![CDATA[####
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
#
# Before building the container image run:
Expand All @@ -7,11 +7,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native -t quarkus/code-with-quarkus .
# docker build . -f=src/main/docker/Dockerfile.native -t=nop/${appName}-app .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus
# docker run -i --rm -p 8080:8080 nop/${appName}-app
#
###
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8
Expand All @@ -25,3 +25,4 @@ EXPOSE 8080
USER 1001

ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
]]></c:unit>
2 changes: 2 additions & 0 deletions nop-demo/nop-quarkus-demo/build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mvn install -DskipTests
docker build . -f=src/main/docker/Dockerfile.jvm -t=nop/quarkus-demo
1 change: 1 addition & 0 deletions nop-demo/nop-quarkus-demo/build-native-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker build . -f=src/main/docker/Dockerfile.native-micro -t=nop/quarkus-demo
4 changes: 4 additions & 0 deletions nop-demo/nop-quarkus-demo/build-native.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set GRAALVM_HOME=C:\Software\graalvm
set JAVA_HOME=%GRAALVM_HOME%
set Path=%GRAALVM_HOME%\bin;%Path%
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" && mvn package -DskipTests -Pnative
1 change: 1 addition & 0 deletions nop-demo/nop-quarkus-demo/run-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run -i --rm -p 8080:8080 nop/quarkus-demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
[
"io.nop.auth.dao.mapper.NopAuthRoleMapper"
],
[
"io.nop.auth.dao.mapper.NopAuthUserMapper"
]
]
Loading

0 comments on commit b51fd5b

Please sign in to comment.