From 708e7ad11542a31f85fbb4a2b57b0d78f39bbf66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Youen=20P=C3=A9ron?= Date: Mon, 25 Sep 2023 13:20:43 +0000 Subject: [PATCH] fix: user creation --- .devcontainer/devcontainer.json | 19 +++++++++++++++++++ Dockerfile.debian | 12 ++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..009a80f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,19 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/debian +{ + "name": "Debian", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:bullseye" + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/Dockerfile.debian b/Dockerfile.debian index ce6b71f..3560cc6 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -24,6 +24,10 @@ ARG VERSION_MC=RELEASE.2023-09-07T22-48-55Z ARG VERSION_DSQ=0.23.0 ARG VERSION_DEBIAN=stable-20230904-slim +ARG USERNAME=lino +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + FROM cgifr/pimo:${VERSION_PIMO} AS pimo @@ -69,6 +73,10 @@ COPY --from=pimo /usr/bin/pimo /usr/bin/pimo COPY --from=lino /usr/bin/lino /usr/bin/lino COPY --from=mc /usr/bin/mc /usr/bin/mc -USER 1000:1000 +# Create the user lino +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME + +USER $USERNAME -WORKDIR /home/lino +WORKDIR /home/$USERNAME