From d51bc2c510587c2cd48ed5e42bee496091acd4e7 Mon Sep 17 00:00:00 2001 From: Sho Ishida Date: Thu, 16 Jul 2026 05:37:17 +0000 Subject: [PATCH] Initialize container --- .devcontainer/Dockerfile | 22 ++++++++++++++++++++++ .devcontainer/devcontainer.json | 23 +++++++++++++++++++++++ 2 files changed, 45 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 0000000..4478202 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,22 @@ +FROM mcr.microsoft.com/devcontainers/python:1-3.12-bookworm + +RUN rm -f /etc/apt/sources.list.d/yarn.list \ + && apt-get update && apt-get install -y \ + curl \ + gnupg \ + software-properties-common \ + git \ + openssh-client \ + genisoimage \ + && rm -rf /var/lib/apt/lists/* + +RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com bookworm main" | tee /etc/apt/sources.list.d/hashicorp.list \ + && apt-get update && apt-get install -y terraform \ + && rm -rf /var/lib/apt/lists/* + +RUN pip install --no-cache-dir --upgrade pip \ + && pip install --no-cache-dir \ + ansible \ + ansible-navigator \ + ansible-lint diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..2f19358 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,23 @@ +{ + "name": "Homelab Dev Container", + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "redhat.ansible", + "hashicorp.terraform", + "eamodio.gitlens" + ] + } + }, + "features": {}, + "mounts": [ + "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" + ], + "forwardPorts": [], + "postCreateCommand": "ssh-keyscan -H 172.30.1.200 >> ~/.ssh/known_hosts 2> /dev/null || true", + "remoteUser": "vscode" +}