From 0f40fe62705193f8948ee6487380234cd8552e7d Mon Sep 17 00:00:00 2001 From: Jonah Aragon Date: Wed, 11 Jun 2025 13:45:55 -0600 Subject: [PATCH 1/2] Add devcontainer config --- .devcontainer/Dockerfile | 22 ++++++++++++++++++++ .devcontainer/devcontainer.json | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..1b839defe60 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,22 @@ +FROM geerlingguy/docker-debian12-ansible:latest + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + python3-passlib \ + git \ + pwgen \ + openssh-client \ + curl && \ + rm -rf /var/lib/apt/lists/* && \ + rm -Rf /usr/share/doc && rm -Rf /usr/share/man && \ + apt-get clean + +# Install Just +RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin + +# Preserve command history across container restarts +RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \ + && echo "$SNIPPET" >> "/root/.bashrc" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..32327e43498 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,37 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "matrix-docker-ansible-deploy", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "postCreateCommand": { + "Fix Volume Permissions": "sudo chown -R $(whoami): /commandhistory" + }, + "postAttachCommand": "bash", + "mounts": [ + { + "source": "${localEnv:SSH_AUTH_SOCK}", + "target": "/agent.sock", + "type": "bind" + }, + { + "source": "matrix-docker-ansible-deploy-bashhistory", + "target": "/commandhistory", + "type": "volume" + } + ], + "containerEnv": { + "SSH_AUTH_SOCK": "/agent.sock" + }, + "customizations": { + "vscode": { + "extensions": [ + "EditorConfig.EditorConfig", + "redhat.ansible", + "redhat.vscode-yaml", + "ms-python.python" + ] + } + } +} From 4a4ca67465561ab5a58e8b80803b8ffa926cfcab Mon Sep 17 00:00:00 2001 From: Jonah Aragon Date: Tue, 22 Jul 2025 11:04:03 -0500 Subject: [PATCH 2/2] Use `ghcr.io/devture/ansible` image --- .devcontainer/Dockerfile | 25 ++++++------------------- .devcontainer/devcontainer.json | 11 +---------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1b839defe60..12fef5507ad 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,22 +1,9 @@ -FROM geerlingguy/docker-debian12-ansible:latest +FROM ghcr.io/devture/ansible:11.1.0-r0-0 -ENV LANG=C.UTF-8 -ENV LC_ALL=C.UTF-8 - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - python3-passlib \ - git \ - pwgen \ - openssh-client \ - curl && \ - rm -rf /var/lib/apt/lists/* && \ - rm -Rf /usr/share/doc && rm -Rf /usr/share/man && \ - apt-get clean - -# Install Just -RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin +# Install additional packages +RUN apk add --no-cache \ + pwgen # Preserve command history across container restarts -RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \ - && echo "$SNIPPET" >> "/root/.bashrc" +RUN SNIPPET="export HISTFILE=/commandhistory/.ash_history" \ + && echo "$SNIPPET" >> "/root/.profile" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 32327e43498..5cf3a48a13c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,24 +6,15 @@ "context": ".." }, "postCreateCommand": { - "Fix Volume Permissions": "sudo chown -R $(whoami): /commandhistory" + "Fix Volume Permissions": "chown -R $(whoami): /commandhistory" }, - "postAttachCommand": "bash", "mounts": [ - { - "source": "${localEnv:SSH_AUTH_SOCK}", - "target": "/agent.sock", - "type": "bind" - }, { "source": "matrix-docker-ansible-deploy-bashhistory", "target": "/commandhistory", "type": "volume" } ], - "containerEnv": { - "SSH_AUTH_SOCK": "/agent.sock" - }, "customizations": { "vscode": { "extensions": [