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 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 <https://github.com/containers/podman/discussions/19931>.
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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": {},
|
||||
|
|
|
|||
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