forked from mj/devopsscripts
增加部署dockerfile
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
FROM harbor.zzmjart.com/library/compile:1.0.0 as builder
|
||||
FROM 172.31.127.251:8083/library/compile:1.0.0 as builder
|
||||
COPY .git .git
|
||||
COPY src src
|
||||
COPY pom.xml .
|
||||
COPY settings.xml .
|
||||
RUN mvn -s ./settings.xml clean package -DskipTests=true
|
||||
RUN mvn clean package -DskipTests=true
|
||||
|
||||
|
||||
FROM harbor.zzmjart.com/library/java17:1.0.0
|
||||
FROM 172.31.127.251:8083/library/java21:1.0.0
|
||||
ARG PROJECTCODE
|
||||
ARG PROJECTVERSION
|
||||
LABEL author=wangchuan<wangzefu520@163.com>
|
||||
@@ -18,7 +17,20 @@ ENV ENV_ACTIVE="prod" \
|
||||
JAVA_OPS="" \
|
||||
APP_OPS="" \
|
||||
SKYWALKING_OPS="" \
|
||||
GC_OPS="-XX:+UseG1GC -XX:+UseStringDeduplication -XX:+OptimizeStringConcat -XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*=info:file=$LOGS_HOME/gc.log:time,level,tags:filecount=30,filesize=50M -XX:HeapDumpPath=$LOGS_HOME/app.dump"
|
||||
GC_OPS="-Xms512m -Xmx512m \
|
||||
-XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m \
|
||||
-XX:+UseG1GC \
|
||||
-XX:MaxGCPauseMillis=200 \
|
||||
-XX:MaxDirectMemorySize=256m \
|
||||
-XX:+UseContainerSupport \
|
||||
-XX:+UseStringDeduplication \
|
||||
-XX:+OptimizeStringConcat \
|
||||
-Djava.security.egd=file:/dev/./urandom \
|
||||
-Dspring.backgroundpreinitializer.ignore=true \
|
||||
-Duser.timezone=GMT+08 \
|
||||
-XX:+HeapDumpOnOutOfMemoryError \
|
||||
-Xlog:gc*=info:file=$LOGS_HOME/gc.log:time,level,tags:filecount=30,filesize=50M \
|
||||
-XX:HeapDumpPath=$LOGS_HOME/app.dump"
|
||||
RUN addgroup -g 1000 1000 && \
|
||||
adduser -u 1000 -G 1000 -S -D -H 1000 && \
|
||||
chown 1000:1000 -R $APP_HOME $LOGS_HOME && \
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
FROM ghcr.io/graalvm/graalvm-community:25
|
||||
|
||||
RUN microdnf --refresh -y install findutils openssh-clients
|
||||
|
||||
# common for all images
|
||||
LABEL org.opencontainers.image.title="Apache Maven"
|
||||
LABEL org.opencontainers.image.source=https://github.com/carlossg/docker-maven
|
||||
LABEL org.opencontainers.image.url=https://github.com/carlossg/docker-maven
|
||||
LABEL org.opencontainers.image.description="Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information."
|
||||
|
||||
ENV MAVEN_HOME=/usr/share/maven
|
||||
|
||||
COPY --from=maven:3.9.12-eclipse-temurin-17 ${MAVEN_HOME} ${MAVEN_HOME}
|
||||
COPY --from=maven:3.9.12-eclipse-temurin-17 /usr/local/bin/mvn-entrypoint.sh /usr/local/bin/mvn-entrypoint.sh
|
||||
COPY --from=maven:3.9.12-eclipse-temurin-17 /usr/share/maven/ref/settings-docker.xml /usr/share/maven/ref/settings-docker.xml
|
||||
|
||||
RUN ln -s ${MAVEN_HOME}/bin/mvn /usr/bin/mvn
|
||||
|
||||
ARG MAVEN_VERSION=3.9.12
|
||||
ARG USER_HOME_DIR="/root"
|
||||
ENV MAVEN_CONFIG="$USER_HOME_DIR/.m2"
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/mvn-entrypoint.sh"]
|
||||
CMD ["mvn"]
|
||||
4
base/compile/Dockerfile
Normal file
4
base/compile/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM 172.31.127.251:8083/library/maven:3.9.12-eclipse-temurin-21-alpine
|
||||
COPY settings.xml $MAVEN_CONFIG/
|
||||
COPY settings-security.xml $MAVEN_CONFIG/
|
||||
|
||||
12
base/java21/Dockerfile
Normal file
12
base/java21/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM 172.31.127.251:8083/library/eclipse-temurin:21-jdk-alpine-3.23
|
||||
LABEL author=wangchuan<wangzefu520@163.com>
|
||||
COPY --chmod=745 gosu-amd64 /usr/local/bin/gosu
|
||||
ENV TZ=Asia/Shanghai \
|
||||
APP_HOME=/usr/local/app \
|
||||
LOGS_HOME=/usr/local/logs
|
||||
RUN set -eux; \
|
||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories; \
|
||||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; \
|
||||
echo "Asia/Shanghai" > /etc/timezone; \
|
||||
mkdir -p $APP_HOME $LOGS_HOME;
|
||||
|
||||
BIN
base/java21/gosu-amd64
Normal file
BIN
base/java21/gosu-amd64
Normal file
Binary file not shown.
Reference in New Issue
Block a user