use kaniko to build container

This commit is contained in:
Sebastian Hugentobler 2022-02-15 12:22:17 +01:00
parent c9db2ac370
commit 04bc0ba371
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0
7 changed files with 19 additions and 34 deletions

View File

@ -1,9 +0,0 @@
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

View File

@ -1,13 +1,18 @@
variables:
IMAGE_NAME: thallian/airsonic
CONTAINER_NAME: thallian/airsonic
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD $DOCKER_REGISTRY
- docker build -t $IMAGE_NAME:$CI_COMMIT_SHA .
- docker build -t $IMAGE_NAME:$CI_COMMIT_REF_NAME .
- docker build -t $IMAGE_NAME:latest .
- docker push $IMAGE_NAME:$CI_COMMIT_SHA
- docker push $IMAGE_NAME:$CI_COMMIT_REF_NAME
- docker push $IMAGE_NAME:latest
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--context "$CI_PROJECT_DIR"
--dockerfile "$CI_PROJECT_DIR/Dockerfile"
--destination "$CONTAINER_NAME:$CI_COMMIT_SHA"
--destination "$CONTAINER_NAME:$CI_COMMIT_REF_NAME"
--destination "$CONTAINER_NAME:latest"

View File

@ -1,8 +1,8 @@
FROM alpine:3.14 AS builder
FROM alpine:3.15 AS builder
ENV VERSION=11.0.0-SNAPSHOT.20211214174334
ENV VERSION=11.0.0-SNAPSHOT.20220213174344
RUN apk add --no-cache \
openjdk11-jdk \
openjdk17-jdk \
maven \
git
@ -24,10 +24,8 @@ RUN apk add --no-cache \
ffmpeg \
flac \
opus \
lame
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
openjdk17-jre-headless
lame \
openjdk17-jre-headless
RUN addgroup -g 2222 airsonic
RUN adduser -h "$AIRSONIC_DIR" -S -D -u 2222 -G airsonic airsonic

View File

@ -1,10 +0,0 @@
/home/airsonic/data/db true airsonic 0644 0755
/home/airsonic/data/lastfmcache true airsonic 0644 0755
/home/airsonic/data/lucene2 true airsonic 0644 0755
/home/airsonic/data/thumbs true airsonic 0644 0755
/home/airsonic/data/transcode false airsonic 0644 0755
/home/airsonic/playlists true airsonic 0640 0755
/home/airsonic/podcasts true airsonic 0640 0755
/home/airsonic/airsonic.log false airsonic 0640 0755
/home/airsonic/airsonic.properties false airsonic 0640 0755
/home/airsonic/rollback.sql false airsonic 0640 0755

View File

@ -0,0 +1 @@
longrun