Compare commits
4 commits
6c0a82b2e0
...
de02240022
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de02240022 | ||
|
|
f5f88e79fb | ||
|
|
ce19be2e68 | ||
|
|
0817d7be67 |
7 changed files with 125 additions and 3 deletions
45
.devcontainer/Containerfile
Normal file
45
.devcontainer/Containerfile
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
# 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.
|
||||||
|
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 ssh && \
|
||||||
|
apt-get upgrade -y
|
||||||
|
|
||||||
|
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/webgui/.config/containers/containers.conf
|
||||||
|
|
||||||
|
RUN mkdir -p /home/webgui/.local/share/containers && \
|
||||||
|
chown webgui:webgui -R /home/webgui && \
|
||||||
|
chmod 0644 /etc/containers/containers.conf
|
||||||
|
|
||||||
|
VOLUME /home/webgui/.local/share/containers
|
||||||
|
|
||||||
|
# Replace setuid bits by proper file capabilities for uidmap binaries.
|
||||||
|
# See <https://github.com/containers/podman/discussions/19931>.
|
||||||
|
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 webgui
|
||||||
|
#WORKDIR /home/webgui
|
||||||
|
|
||||||
23
.devcontainer/compose.yml
Normal file
23
.devcontainer/compose.yml
Normal file
|
|
@ -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
|
||||||
|
|
||||||
35
.devcontainer/devcontainer.json
Normal file
35
.devcontainer/devcontainer.json
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
// 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
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
||||||
1
.devcontainer/memory/MEMORY.md
Normal file
1
.devcontainer/memory/MEMORY.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
- [Uses podman not docker](user_podman.md) — uses podman and podman-compose instead of Docker
|
||||||
8
.devcontainer/memory/user_podman.md
Normal file
8
.devcontainer/memory/user_podman.md
Normal file
|
|
@ -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.
|
||||||
14
Dockerfile
14
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
|
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 \
|
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 \
|
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 \
|
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 \
|
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
|
#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
|
WORKDIR /data/WebGUI
|
||||||
|
|
||||||
CMD [ "/entrypoint" ]
|
CMD [ "/entrypoint" ]
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ services:
|
||||||
- "80"
|
- "80"
|
||||||
|
|
||||||
nginx-proxy:
|
nginx-proxy:
|
||||||
image: nginx:latest
|
image: docker.io/nginx:latest
|
||||||
container_name: nginx_proxy
|
container_name: nginx_proxy
|
||||||
depends_on:
|
depends_on:
|
||||||
- webgui
|
- webgui
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue