From 85ce376ad033aab541a73b7cf44ab19605e96b77 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 11:34:47 +0200 Subject: [PATCH] Switch to appuser Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 12 ++++-------- docker/jekyll/Dockerfile | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 3ca3f69..21ed9b3 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -5,6 +5,8 @@ on: [push] env: _UID: 1000 _GID: 1000 + _USER: appuser + _GROUP: appgroup jobs: jekyll: runs-on: ubuntu-22.04 @@ -33,18 +35,12 @@ jobs: - name: Build Jekyll image id: build_image run: | - # The environment variables _UID and _GID will impact this image + # The environment variables _UID, _GID, _USER and _GROUP will impact this image docker-compose build jekyll - - name: Verify Jekyll container - id: verify_image - run: | - docker-compose run --rm -v "/var/lib/docker/volumes/${JOB_CONTAINER_NAME}/_data:/home/ubuntu/workspace" \ - --entrypoint bash \ - jekyll -c "whoami; pwd; ls -lA ." - name: Build Jekyll site id: build_site run: | - docker-compose run --rm -v "/var/lib/docker/volumes/${JOB_CONTAINER_NAME}/_data:/home/ubuntu/workspace" \ + docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/home/${_USER}/workspace" \ jekyll build --verbose - name: Verify site id: verify_site diff --git a/docker/jekyll/Dockerfile b/docker/jekyll/Dockerfile index 9349ade..bd398dd 100644 --- a/docker/jekyll/Dockerfile +++ b/docker/jekyll/Dockerfile @@ -10,9 +10,9 @@ RUN INSTALL_PKGS="gcc g++ libyaml-dev make nodejs" && \ # Parameters for default user:group ARG uid=1000 -ARG user=ubuntu +ARG user=appuser ARG gid=1000 -ARG group=ubuntu +ARG group=appgroup # Ensure desired user and group for build and runtime (convenient) RUN userdel --force --remove $(getent passwd ${uid} | cut -d: -f1) || true; \