Просмотр исходного кода

Add devcontainer config

pull/4365/head
Jonah Aragon 8 месяцев назад
Родитель
Сommit
0f40fe6270
Не удалось извлечь подпись
2 измененных файлов: 59 добавлений и 0 удалений
  1. +22
    -0
      .devcontainer/Dockerfile
  2. +37
    -0
      .devcontainer/devcontainer.json

+ 22
- 0
.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"

+ 37
- 0
.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"
]
}
}
}

Загрузка…
Отмена
Сохранить