From fc8c0a489f872577e024b11dc5094af1809f7e8c Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Tue, 15 Feb 2022 16:21:13 +0100 Subject: [PATCH] use new s6-rc layout --- .gitlab-ci.yml | 24 ++++++++++++------- .../02-static-user => bin/static-user} | 2 +- rootfs/etc/fix-attrs.d/01-data | 1 - .../s6-overlay/s6-rc.d/proftpd/dependencies | 2 ++ rootfs/etc/s6-overlay/s6-rc.d/proftpd/run | 3 +++ rootfs/etc/s6-overlay/s6-rc.d/proftpd/type | 1 + .../s6-rc.d/static-user/dependencies | 1 + .../etc/s6-overlay/s6-rc.d/static-user/type | 1 + rootfs/etc/s6-overlay/s6-rc.d/static-user/up | 1 + .../s6-rc.d/user/contents.d/proftpd | 0 rootfs/etc/services.d/proftpd/run | 3 --- 11 files changed, 25 insertions(+), 14 deletions(-) rename rootfs/{etc/cont-init.d/02-static-user => bin/static-user} (91%) mode change 100644 => 100755 delete mode 100644 rootfs/etc/fix-attrs.d/01-data create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/proftpd/dependencies create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/proftpd/run create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/proftpd/type create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/static-user/dependencies create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/static-user/type create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/static-user/up create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/proftpd delete mode 100644 rootfs/etc/services.d/proftpd/run diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6c9cb03..19675aa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,18 @@ -stages: - - build - variables: - IMAGE_NAME: thallian/user-access - CI_BUILD_ARCHS: "linux/amd64,linux/arm64" + CONTAINER_NAME: thallian/user-access build: - stage: build - script: - - docker login -u $DOCKER_USER -p $DOCKER_PASSWORD $DOCKER_REGISTRY - - docker buildx build --platform "$CI_BUILD_ARCHS" --progress plain --pull --tag "$IMAGE_NAME:$CI_COMMIT_SHA" --tag "$IMAGE_NAME:$CI_COMMIT_REF_NAME" --tag "$IMAGE_NAME:latest" --push . + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - 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/rootfs/etc/cont-init.d/02-static-user b/rootfs/bin/static-user old mode 100644 new mode 100755 similarity index 91% rename from rootfs/etc/cont-init.d/02-static-user rename to rootfs/bin/static-user index 28bd436..c3d62c4 --- a/rootfs/etc/cont-init.d/02-static-user +++ b/rootfs/bin/static-user @@ -1,4 +1,4 @@ -#!/usr/bin/with-contenv sh +#!/bin/sh if [ ! -z ${STATIC_USER+x} ]; then echo ${STATIC_PASSWORD} | ftpasswd \ diff --git a/rootfs/etc/fix-attrs.d/01-data b/rootfs/etc/fix-attrs.d/01-data deleted file mode 100644 index 9ff8fd0..0000000 --- a/rootfs/etc/fix-attrs.d/01-data +++ /dev/null @@ -1 +0,0 @@ -/var/lib/ftp/data/ true proftpd:access 0666 0777 diff --git a/rootfs/etc/s6-overlay/s6-rc.d/proftpd/dependencies b/rootfs/etc/s6-overlay/s6-rc.d/proftpd/dependencies new file mode 100644 index 0000000..64f28ce --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/proftpd/dependencies @@ -0,0 +1,2 @@ +confd +static-user diff --git a/rootfs/etc/s6-overlay/s6-rc.d/proftpd/run b/rootfs/etc/s6-overlay/s6-rc.d/proftpd/run new file mode 100644 index 0000000..e493d09 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/proftpd/run @@ -0,0 +1,3 @@ +#!/bin/sh + +exec proftpd --nodaemon diff --git a/rootfs/etc/s6-overlay/s6-rc.d/proftpd/type b/rootfs/etc/s6-overlay/s6-rc.d/proftpd/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/proftpd/type @@ -0,0 +1 @@ +longrun diff --git a/rootfs/etc/s6-overlay/s6-rc.d/static-user/dependencies b/rootfs/etc/s6-overlay/s6-rc.d/static-user/dependencies new file mode 100644 index 0000000..7ba7514 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/static-user/dependencies @@ -0,0 +1 @@ +confd diff --git a/rootfs/etc/s6-overlay/s6-rc.d/static-user/type b/rootfs/etc/s6-overlay/s6-rc.d/static-user/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/static-user/type @@ -0,0 +1 @@ +oneshot diff --git a/rootfs/etc/s6-overlay/s6-rc.d/static-user/up b/rootfs/etc/s6-overlay/s6-rc.d/static-user/up new file mode 100644 index 0000000..d13e8c0 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/static-user/up @@ -0,0 +1 @@ +static-user diff --git a/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/proftpd b/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/proftpd new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/etc/services.d/proftpd/run b/rootfs/etc/services.d/proftpd/run deleted file mode 100644 index baf408e..0000000 --- a/rootfs/etc/services.d/proftpd/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv sh - -exec proftpd --nodaemon