From 0817d7be67dc99e13dec0b48d5849c412d780eb4 Mon Sep 17 00:00:00 2001 From: arjan Date: Wed, 20 May 2026 12:38:14 +0200 Subject: [PATCH 1/4] basics working, being rebuild and reopen remote --- .devcontainer/Containerfile | 45 +++++++++++++++++++++++++++++++++ .devcontainer/compose.yml | 23 +++++++++++++++++ .devcontainer/devcontainer.json | 34 +++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 .devcontainer/Containerfile create mode 100644 .devcontainer/compose.yml create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Containerfile b/.devcontainer/Containerfile new file mode 100644 index 000000000..f0d33e7f4 --- /dev/null +++ b/.devcontainer/Containerfile @@ -0,0 +1,45 @@ +# Dockerfile +# podman image build -q -t debian:podman-trixie -f Containerfile . +# podman run -q -it --rm --device /dev/fuse debian:podman-trixie + # in development container e.g. +FROM debian:trixie + +ENV DEBIAN_FRONTEND="noninteractive" + +RUN apt-get update && \ + apt-get install -y --no-install-recommends podman podman-compose \ + fuse-overlayfs slirp4netns uidmap iptables aardvark-dns nftables ca-certificates sudo \ + git && \ + apt-get upgrade -y + +RUN useradd vscode -s /bin/bash && \ + echo "vscode:1001:64535" > /etc/subuid && \ + echo "vscode:1001:64535" > /etc/subgid + +ARG _REPO_URL="https://raw.githubusercontent.com/containers/image_build/refs/heads/main/podman" +ADD $_REPO_URL/containers.conf /etc/containers/containers.conf +ADD $_REPO_URL/podman-containers.conf /home/vscode/.config/containers/containers.conf + +RUN mkdir -p /home/vscode/.local/share/containers && \ + chown vscode:vscode -R /home/vscode && \ + chmod 0644 /etc/containers/containers.conf + +VOLUME /home/vscode/.local/share/containers + +# Replace setuid bits by proper file capabilities for uidmap binaries. +# See . +RUN apt-get install -y libcap2-bin && \ + chmod 0755 /usr/bin/newuidmap /usr/bin/newgidmap && \ + setcap cap_setuid=ep /usr/bin/newuidmap && \ + setcap cap_setgid=ep /usr/bin/newgidmap && \ + apt-get autoremove --purge -y libcap2-bin + +ENV _CONTAINERS_USERNS_CONFIGURED="" + +#RUN SNIPPET="export PROMPT_COMMAND='history -a' && \ +# export HISTFILE=/commandhistory/.bash_history" && \ +# echo "$SNIPPET" >> "/root/.bashrc" + +#USER vscode +#WORKDIR /home/vscode + diff --git a/.devcontainer/compose.yml b/.devcontainer/compose.yml new file mode 100644 index 000000000..0988096c5 --- /dev/null +++ b/.devcontainer/compose.yml @@ -0,0 +1,23 @@ +# compose.yml +version: '3.8' +#volumes: +# projectname-bashhistory: # Define named volume for bash history + +# Note: The 'bashhistory' service is used to persist bash history data across different containers. +services: +# bashhistory: +# volumes: +# - projectname-bashhistory:/commandhistory:z # Mount the named volume to /commandhistory in bashhistory service + + devcontainer: + container_name: devcontainer + privileged: true + hostname: devcontainer + build: + context: . + dockerfile: Containerfile + volumes: + - ..:/workspace:cached # Mount parent directory to workspace + # - projectname-bashhistory:/commandhistory:z # Mount the named volume to /commandhistory in devcontainer service + command: sleep infinity + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..9fe1c661d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,34 @@ +// 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": "devcontainer", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile +// "image": "mcr.microsoft.com/devcontainers/base:trixie" +// "build": { +// "dockerfile": "Dockerfile" +// } + "dockerComposeFile": "compose.yml", + "service": "devcontainer", + + // default workspace path in container to open + "workspaceFolder": "/workspace" //${localWorkspaceFolder}" + +// "mounts": [ +// "source=projectname-bashhistory,target=/commandhistory,type=volume" +// ], +// "postCreateCommand": { +// "Fix Volume Permissions": "chown -R $(whoami): /commandhistory" +// } + + // 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" +} From ce19be2e68b1a6f71d932040eafafffc6452ed86 Mon Sep 17 00:00:00 2001 From: arjan Date: Wed, 20 May 2026 14:46:24 +0200 Subject: [PATCH 2/4] persistent history, add podman to memory.md, user webgui --- .devcontainer/Containerfile | 26 +++++++++++++------------- .devcontainer/compose.yml | 6 +++--- .devcontainer/devcontainer.json | 9 +++++---- .devcontainer/memory/MEMORY.md | 1 + .devcontainer/memory/user_podman.md | 8 ++++++++ 5 files changed, 30 insertions(+), 20 deletions(-) create mode 100644 .devcontainer/memory/MEMORY.md create mode 100644 .devcontainer/memory/user_podman.md diff --git a/.devcontainer/Containerfile b/.devcontainer/Containerfile index f0d33e7f4..579273788 100644 --- a/.devcontainer/Containerfile +++ b/.devcontainer/Containerfile @@ -1,4 +1,4 @@ -# Dockerfile +# Containerfile # podman image build -q -t debian:podman-trixie -f Containerfile . # podman run -q -it --rm --device /dev/fuse debian:podman-trixie # in development container e.g. @@ -12,19 +12,19 @@ RUN apt-get update && \ git && \ apt-get upgrade -y -RUN useradd vscode -s /bin/bash && \ - echo "vscode:1001:64535" > /etc/subuid && \ - echo "vscode:1001:64535" > /etc/subgid +RUN useradd webgui -s /bin/bash && \ + echo "webgui:1001:64535" > /etc/subuid && \ + echo "webgui:1001:64535" > /etc/subgid ARG _REPO_URL="https://raw.githubusercontent.com/containers/image_build/refs/heads/main/podman" ADD $_REPO_URL/containers.conf /etc/containers/containers.conf -ADD $_REPO_URL/podman-containers.conf /home/vscode/.config/containers/containers.conf +ADD $_REPO_URL/podman-containers.conf /home/webgui/.config/containers/containers.conf -RUN mkdir -p /home/vscode/.local/share/containers && \ - chown vscode:vscode -R /home/vscode && \ +RUN mkdir -p /home/webgui/.local/share/containers && \ + chown webgui:webgui -R /home/webgui && \ chmod 0644 /etc/containers/containers.conf -VOLUME /home/vscode/.local/share/containers +VOLUME /home/webgui/.local/share/containers # Replace setuid bits by proper file capabilities for uidmap binaries. # See . @@ -36,10 +36,10 @@ RUN apt-get install -y libcap2-bin && \ ENV _CONTAINERS_USERNS_CONFIGURED="" -#RUN SNIPPET="export PROMPT_COMMAND='history -a' && \ -# export HISTFILE=/commandhistory/.bash_history" && \ -# echo "$SNIPPET" >> "/root/.bashrc" +RUN SNIPPET="export PROMPT_COMMAND='history -a' && \ + export HISTFILE=/commandhistory/.bash_history" && \ + echo "$SNIPPET" >> "/root/.bashrc" -#USER vscode -#WORKDIR /home/vscode +#USER webgui +#WORKDIR /home/webgui diff --git a/.devcontainer/compose.yml b/.devcontainer/compose.yml index 0988096c5..88d121223 100644 --- a/.devcontainer/compose.yml +++ b/.devcontainer/compose.yml @@ -1,7 +1,7 @@ # compose.yml version: '3.8' -#volumes: -# projectname-bashhistory: # Define named volume for bash history +volumes: + projectname-bashhistory: # Define named volume for bash history # Note: The 'bashhistory' service is used to persist bash history data across different containers. services: @@ -18,6 +18,6 @@ services: dockerfile: Containerfile volumes: - ..:/workspace:cached # Mount parent directory to workspace - # - projectname-bashhistory:/commandhistory:z # Mount the named volume to /commandhistory in devcontainer service + - projectname-bashhistory:/commandhistory:z # Mount the named volume to /commandhistory in devcontainer service command: sleep infinity diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9fe1c661d..32ceba81b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,3 +1,4 @@ +// devcontainer.json // 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 { @@ -11,14 +12,14 @@ "service": "devcontainer", // default workspace path in container to open - "workspaceFolder": "/workspace" //${localWorkspaceFolder}" + "workspaceFolder": "/workspace", //${localWorkspaceFolder}" // "mounts": [ // "source=projectname-bashhistory,target=/commandhistory,type=volume" // ], -// "postCreateCommand": { -// "Fix Volume Permissions": "chown -R $(whoami): /commandhistory" -// } + "postCreateCommand": { + "Fix Volume Permissions": "chown -R $(whoami): /commandhistory" + } // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, diff --git a/.devcontainer/memory/MEMORY.md b/.devcontainer/memory/MEMORY.md new file mode 100644 index 000000000..dcfb49d98 --- /dev/null +++ b/.devcontainer/memory/MEMORY.md @@ -0,0 +1 @@ +- [Uses podman not docker](user_podman.md) — uses podman and podman-compose instead of Docker diff --git a/.devcontainer/memory/user_podman.md b/.devcontainer/memory/user_podman.md new file mode 100644 index 000000000..9c61c1eba --- /dev/null +++ b/.devcontainer/memory/user_podman.md @@ -0,0 +1,8 @@ +--- +name: user_podman +description: User uses podman and podman-compose, not Docker +metadata: + type: user +--- + +Uses **podman** and **podman-compose** for containerization, not Docker/Docker Compose. Compose file format is identical but the runtime and tooling is different. From f5f88e79fb1d145f525581af86d671361e80173a Mon Sep 17 00:00:00 2001 From: arjan Date: Wed, 20 May 2026 14:33:34 +0000 Subject: [PATCH 3/4] as in previous message --- Dockerfile | 14 ++++++++++++-- distribution/docker-compose.yml | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bee1e043b..33d07a262 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,16 @@ +# Podman Containerfile +# build via compose.yml or: +# podman image build -q -t debian:podman-trixie -f Containerfile . FROM debian:trixie -ENV DEBIAN_FRONTEND=noninteractive +ENV DEBIAN_FRONTEND="noninteractive" RUN apt update && apt -y install perl cpanminus libaspell-dev make libdbd-mysql-perl libdigest-perl-md5-perl libxml-simple-perl \ libmodule-install-perl gcc libperl-dev default-libmysqlclient-dev libpng-dev build-essential libgd-dev mariadb-client imagemagick \ libpng-dev libjpeg-dev libtiff-dev libapache2-mod-perl2 libapache2-mod-perl2-dev libapache2-request-perl libimage-magick-perl vim \ - apache2 apache2-utils mailutils + apache2 apache2-utils mailutils \ +# could be removed for production: + curl procps RUN cpanm --notest --no-cache --force \ @@ -168,6 +173,11 @@ RUN useradd --home=/data/WebGUI webgui; chown -R webgui: /data/WebGUI; chmod 755 #USER webgui +# zorgt voor een andere shell prompt in de container gestart in de development container +# ook wanneer die in dezelfde UTC namespace zit - always /after/ USER command +ENV CONTAINER_CONTEXT=inner +RUN printf '%s\n' 'export PS1="\u@${CONTAINER_CONTEXT}:\w\\$ "' >> ~/.bashrc + WORKDIR /data/WebGUI CMD [ "/entrypoint" ] diff --git a/distribution/docker-compose.yml b/distribution/docker-compose.yml index af39eaf88..2d64ab285 100644 --- a/distribution/docker-compose.yml +++ b/distribution/docker-compose.yml @@ -29,7 +29,7 @@ services: - "80" nginx-proxy: - image: nginx:latest + image: docker.io/nginx:latest container_name: nginx_proxy depends_on: - webgui From de022400229093afa0cceb5923b1845e5c3179fb Mon Sep 17 00:00:00 2001 From: arjan Date: Wed, 20 May 2026 16:36:18 +0200 Subject: [PATCH 4/4] added ssh to tools for devcontainer --- .devcontainer/Containerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Containerfile b/.devcontainer/Containerfile index 579273788..dbe6b4bb2 100644 --- a/.devcontainer/Containerfile +++ b/.devcontainer/Containerfile @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND="noninteractive" RUN apt-get update && \ apt-get install -y --no-install-recommends podman podman-compose \ fuse-overlayfs slirp4netns uidmap iptables aardvark-dns nftables ca-certificates sudo \ - git && \ + git ssh && \ apt-get upgrade -y RUN useradd webgui -s /bin/bash && \