Add docker builder
This commit is contained in:
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM eclipse-temurin:17-jdk-alpine
|
||||
LABEL authors="FatttSnake"
|
||||
|
||||
VOLUME /data
|
||||
|
||||
ARG DEPENDENCY=target/extracted
|
||||
COPY ${EXTRACTED}/dependencies/ /
|
||||
COPY ${EXTRACTED}/spring-boot-loader/ /
|
||||
COPY ${EXTRACTED}/snapshot-dependencies/ /
|
||||
COPY ${EXTRACTED}/application/ /
|
||||
|
||||
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "${JAVA_OPTS}"]
|
||||
9
build-docker.sh
Normal file
9
build-docker.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
JAR_NAME=`ls target | grep api-|grep -v original`
|
||||
JAR_VERSION=${JAR_NAME%.*}
|
||||
JAR_VERSION=${JAR_VERSION#*-}
|
||||
|
||||
mkdir target/extracted
|
||||
java -Djarmode=layertools -jar target/*.jar extract --destination target/extracted
|
||||
docker build -t hub.fatweb.top/fatweb-api:latest -t hub.fatweb.top/fatweb-api:$JAR_VERSION -t hub.fatweb.top/fatweb-api:$JAR_VERSION-$(date "+%Y%m%d%H%M%S") .
|
||||
Reference in New Issue
Block a user