ci: switch docker base image to temurin

also publish previous adoptopenjdk image under '-legacy'
This commit is contained in:
Gauthier Roebroeck 2021-12-23 09:54:21 +08:00
parent 63e25a6c5e
commit b64ca41908
4 changed files with 33 additions and 14 deletions

View file

@ -5,17 +5,6 @@
source "$(dirname "$0")/docker-common.sh" $1 $2
# Update Docker CE
#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
#sudo apt-get update
#sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
# Enable buildx
#docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
#docker buildx create --name mybuilder --driver docker-container --use
#docker buildx inspect --bootstrap
# Unpack fat jar
./gradlew unpack
@ -27,3 +16,11 @@ docker buildx build \
--tag gotson/komga:$DOCKER_CHANNEL \
--tag gotson/komga:$1 \
--file ./Dockerfile .
# Temporary: build legacy adoptopenjdk image
docker buildx build \
--platform $PLATFORMS \
--cache-from gotson/komga:$DOCKER_CHANNEL-legacy \
--tag gotson/komga:$DOCKER_CHANNEL-legacy \
--tag gotson/komga:$1-legacy \
--file ./Dockerfile.legacy .

View file

@ -5,8 +5,6 @@
source "$(dirname "$0")/docker-common.sh" $1 $2
#echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Push docker images (built previously)
cd komga
docker buildx build \
@ -16,3 +14,12 @@ docker buildx build \
--tag gotson/komga:$1 \
--file ./Dockerfile . \
--push
# Temporary: build legacy adoptopenjdk image
docker buildx build \
--platform $PLATFORMS \
--cache-from gotson/komga:$DOCKER_CHANNEL-legacy \
--tag gotson/komga:$DOCKER_CHANNEL-legacy \
--tag gotson/komga:$1-legacy \
--file ./Dockerfile.legacy . \
--push

View file

@ -1,4 +1,4 @@
FROM adoptopenjdk:11-jre-hotspot-bionic
FROM eclipse-temurin:11-jre
VOLUME /tmp
ARG DEPENDENCY=build/dependency
WORKDIR app

15
komga/Dockerfile.legacy Normal file
View file

@ -0,0 +1,15 @@
FROM adoptopenjdk:11-jre-hotspot-bionic
VOLUME /tmp
ARG DEPENDENCY=build/dependency
WORKDIR app
COPY ${DEPENDENCY}/dependencies/ ./
COPY ${DEPENDENCY}/spring-boot-loader/ ./
COPY ${DEPENDENCY}/snapshot-dependencies/ ./
COPY ${DEPENDENCY}/application/ ./
ENV KOMGA_DATABASE_FILE="/config/database.sqlite"
ENV KOMGA_LUCENE_DATA_DIRECTORY="/config/lucene"
ENV SPRING_ARTEMIS_EMBEDDED_DATA_DIRECTORY="/config/artemis"
ENV LOGGING_FILE_NAME="/config/logs/komga.log"
ENV LC_ALL=en_US.UTF-8
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:/config/"]
EXPOSE 8080