Initialize minimal container

This commit is contained in:
Sho Ishida 2026-07-14 03:02:46 +00:00
commit 97e58d4eb4
2 changed files with 44 additions and 0 deletions

21
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,21 @@
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 \
&& 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

View File

@ -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"
}