From 9160d819616b89aa446d4916fcaa1f6cdb66851f Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Tue, 15 Feb 2022 17:21:46 +0100 Subject: [PATCH] use new s6-rc layout --- .editorconfig | 9 -------- .gitlab-ci.yml | 21 ++++++++++++------- Dockerfile | 6 +++--- rootfs/etc/fix-attrs.d/01-redis | 1 - .../s6-rc.d/koreader-sync/dependencies | 1 + .../s6-rc.d}/koreader-sync/run | 2 +- .../etc/s6-overlay/s6-rc.d/koreader-sync/type | 1 + .../s6-rc.d}/redis/run | 2 +- rootfs/etc/s6-overlay/s6-rc.d/redis/type | 1 + .../s6-rc.d/user/contents.d/koreader-sync | 0 .../s6-overlay/s6-rc.d/user/contents.d/redis | 0 11 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 .editorconfig delete mode 100644 rootfs/etc/fix-attrs.d/01-redis create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/dependencies rename rootfs/etc/{services.d => s6-overlay/s6-rc.d}/koreader-sync/run (77%) create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/type rename rootfs/etc/{services.d => s6-overlay/s6-rc.d}/redis/run (66%) create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/redis/type create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/koreader-sync create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/redis diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index d741e40..0000000 --- a/.editorconfig +++ /dev/null @@ -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 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b75b53..b8a93ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,18 @@ variables: - IMAGE_NAME: thallian/koreader-sync + CONTAINER_NAME: thallian/koreader-sync 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" diff --git a/Dockerfile b/Dockerfile index 341993e..55c0639 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.14 as builder +FROM alpine:3.15 as builder RUN apk --no-cache add \ bash \ @@ -25,8 +25,8 @@ RUN apk --no-cache add \ RUN ln -s /usr/bin/aclocal-1.16 /usr/bin/aclocal-1.15 RUN ln -s /usr/bin/automake-1.16 /usr/bin/automake-1.15 -ENV RESTY_VERSION=1.19.3.2 -ENV RESTY_SHA256_SUM=ce40e764990fbbeb782e496eb63e214bf19b6f301a453d13f70c4f363d1e5bb9 +ENV RESTY_VERSION=1.19.9.1 +ENV RESTY_SHA256_SUM=576ff4e546e3301ce474deef9345522b7ef3a9d172600c62057f182f3a68c1f6 RUN wget https://openresty.org/download/openresty-$RESTY_VERSION.tar.gz RUN echo "$RESTY_SHA256_SUM openresty-$RESTY_VERSION.tar.gz" | sha256sum -c - || exit 1 diff --git a/rootfs/etc/fix-attrs.d/01-redis b/rootfs/etc/fix-attrs.d/01-redis deleted file mode 100644 index 3ad7eb2..0000000 --- a/rootfs/etc/fix-attrs.d/01-redis +++ /dev/null @@ -1 +0,0 @@ -/var/lib/redis/ true redis 0640 0750 \ No newline at end of file diff --git a/rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/dependencies b/rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/dependencies new file mode 100644 index 0000000..7ba7514 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/dependencies @@ -0,0 +1 @@ +confd diff --git a/rootfs/etc/services.d/koreader-sync/run b/rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/run similarity index 77% rename from rootfs/etc/services.d/koreader-sync/run rename to rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/run index 295b349..6c5e348 100644 --- a/rootfs/etc/services.d/koreader-sync/run +++ b/rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/run @@ -1,4 +1,4 @@ -#!/usr/bin/with-contenv sh +#!/bin/sh cd /app/server s6-setuidgid syncer gin start diff --git a/rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/type b/rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/koreader-sync/type @@ -0,0 +1 @@ +longrun diff --git a/rootfs/etc/services.d/redis/run b/rootfs/etc/s6-overlay/s6-rc.d/redis/run similarity index 66% rename from rootfs/etc/services.d/redis/run rename to rootfs/etc/s6-overlay/s6-rc.d/redis/run index 39fc60e..ef35afb 100644 --- a/rootfs/etc/services.d/redis/run +++ b/rootfs/etc/s6-overlay/s6-rc.d/redis/run @@ -1,3 +1,3 @@ -#!/usr/bin/with-contenv sh +#!/bin/sh exec s6-setuidgid redis redis-server /etc/redis.conf diff --git a/rootfs/etc/s6-overlay/s6-rc.d/redis/type b/rootfs/etc/s6-overlay/s6-rc.d/redis/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/redis/type @@ -0,0 +1 @@ +longrun diff --git a/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/koreader-sync b/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/koreader-sync new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/redis b/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/redis new file mode 100644 index 0000000..e69de29