persistent history, add podman to memory.md, user webgui
This commit is contained in:
parent
0817d7be67
commit
ce19be2e68
5 changed files with 30 additions and 20 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
# Dockerfile
|
# Containerfile
|
||||||
# podman image build -q -t debian:podman-trixie -f Containerfile .
|
# podman image build -q -t debian:podman-trixie -f Containerfile .
|
||||||
# podman run -q -it --rm --device /dev/fuse debian:podman-trixie
|
# podman run -q -it --rm --device /dev/fuse debian:podman-trixie
|
||||||
# in development container e.g.
|
# in development container e.g.
|
||||||
|
|
@ -12,19 +12,19 @@ RUN apt-get update && \
|
||||||
git && \
|
git && \
|
||||||
apt-get upgrade -y
|
apt-get upgrade -y
|
||||||
|
|
||||||
RUN useradd vscode -s /bin/bash && \
|
RUN useradd webgui -s /bin/bash && \
|
||||||
echo "vscode:1001:64535" > /etc/subuid && \
|
echo "webgui:1001:64535" > /etc/subuid && \
|
||||||
echo "vscode:1001:64535" > /etc/subgid
|
echo "webgui:1001:64535" > /etc/subgid
|
||||||
|
|
||||||
ARG _REPO_URL="https://raw.githubusercontent.com/containers/image_build/refs/heads/main/podman"
|
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/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 && \
|
RUN mkdir -p /home/webgui/.local/share/containers && \
|
||||||
chown vscode:vscode -R /home/vscode && \
|
chown webgui:webgui -R /home/webgui && \
|
||||||
chmod 0644 /etc/containers/containers.conf
|
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.
|
# Replace setuid bits by proper file capabilities for uidmap binaries.
|
||||||
# See <https://github.com/containers/podman/discussions/19931>.
|
# See <https://github.com/containers/podman/discussions/19931>.
|
||||||
|
|
@ -36,10 +36,10 @@ RUN apt-get install -y libcap2-bin && \
|
||||||
|
|
||||||
ENV _CONTAINERS_USERNS_CONFIGURED=""
|
ENV _CONTAINERS_USERNS_CONFIGURED=""
|
||||||
|
|
||||||
#RUN SNIPPET="export PROMPT_COMMAND='history -a' && \
|
RUN SNIPPET="export PROMPT_COMMAND='history -a' && \
|
||||||
# export HISTFILE=/commandhistory/.bash_history" && \
|
export HISTFILE=/commandhistory/.bash_history" && \
|
||||||
# echo "$SNIPPET" >> "/root/.bashrc"
|
echo "$SNIPPET" >> "/root/.bashrc"
|
||||||
|
|
||||||
#USER vscode
|
#USER webgui
|
||||||
#WORKDIR /home/vscode
|
#WORKDIR /home/webgui
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# compose.yml
|
# compose.yml
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
#volumes:
|
volumes:
|
||||||
# projectname-bashhistory: # Define named volume for bash history
|
projectname-bashhistory: # Define named volume for bash history
|
||||||
|
|
||||||
# Note: The 'bashhistory' service is used to persist bash history data across different containers.
|
# Note: The 'bashhistory' service is used to persist bash history data across different containers.
|
||||||
services:
|
services:
|
||||||
|
|
@ -18,6 +18,6 @@ services:
|
||||||
dockerfile: Containerfile
|
dockerfile: Containerfile
|
||||||
volumes:
|
volumes:
|
||||||
- ..:/workspace:cached # Mount parent directory to workspace
|
- ..:/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
|
command: sleep infinity
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
// devcontainer.json
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// 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
|
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
|
||||||
{
|
{
|
||||||
|
|
@ -11,14 +12,14 @@
|
||||||
"service": "devcontainer",
|
"service": "devcontainer",
|
||||||
|
|
||||||
// default workspace path in container to open
|
// default workspace path in container to open
|
||||||
"workspaceFolder": "/workspace" //${localWorkspaceFolder}"
|
"workspaceFolder": "/workspace", //${localWorkspaceFolder}"
|
||||||
|
|
||||||
// "mounts": [
|
// "mounts": [
|
||||||
// "source=projectname-bashhistory,target=/commandhistory,type=volume"
|
// "source=projectname-bashhistory,target=/commandhistory,type=volume"
|
||||||
// ],
|
// ],
|
||||||
// "postCreateCommand": {
|
"postCreateCommand": {
|
||||||
// "Fix Volume Permissions": "chown -R $(whoami): /commandhistory"
|
"Fix Volume Permissions": "chown -R $(whoami): /commandhistory"
|
||||||
// }
|
}
|
||||||
|
|
||||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
// "features": {},
|
// "features": {},
|
||||||
|
|
|
||||||
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.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue