Skip to content

Commit b5bfe53

Browse files
authored
Setup remote container and Codespaces configuration (#17)
* Add vanilla Debian devcontainer config files Based on: https://github.com/microsoft/vscode-dev-containers/blob/master/containers/debian/.devcontainer * Set Zsh as default container terminal Zsh is already installed, so this was just a case of changing the VS Code configuration setting. * Use dark colour theme on remote containers * Install shellcheck extension on remote containers * Add docker extension on remote containers * Add yaml extension on remote containers * Add commented out devcontainer postCreateCommand Added it so it's there for reference. * Fix editor problem for git commit messages We now check for either `code` or `code-insiders` to be the editor. * Enable VS Code commit signing flag All this flag does is to add `-S` when calling git commit[1] from within VS Code. [1] microsoft/vscode#97300 (comment)
1 parent 3da6abe commit b5bfe53

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

.devcontainer/Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Based on the example Dockerfile at:
2+
# https://github.com/microsoft/vscode-dev-containers/blob/master/containers/debian/.devcontainer/Dockerfile
3+
4+
# Update the VARIANT arg in devcontainer.json to pick an Debian version: buster (or debian-10), stretch (or debian-9)
5+
ARG VARIANT=buster
6+
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}
7+
8+
# Configure VSCode as the default editor for git commits
9+
# Adapted from https://github.com/microsoft/vscode-dev-containers/blob/master/containers/codespaces-linux/.devcontainer/Dockerfile
10+
ARG GIT_EDITOR_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/containers/codespaces-linux/.devcontainer/git-ed.sh"
11+
RUN mkdir -p /tmp/git-ed \
12+
&& curl -sSL ${GIT_EDITOR_SCRIPT_SOURCE} -o /tmp/git-ed/git-ed.sh \
13+
&& install -m 755 /tmp/git-ed/git-ed.sh /usr/local/bin/git-ed.sh \
14+
&& git config --global core.editor "/usr/local/bin/git-ed.sh" \
15+
# Clean up
16+
&& rm -rf /tmp/git-ed

.devcontainer/devcontainer.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "Docker Container GitHub Action development",
3+
"dockerFile": "Dockerfile",
4+
5+
// Set *default* container specific settings.json values on container create.
6+
"settings": {
7+
"terminal.integrated.shell.linux": "/bin/zsh",
8+
"workbench.colorTheme": "Default Dark+",
9+
},
10+
11+
// Add the IDs of extensions you want installed when the container is created.
12+
"extensions": [
13+
"timonwong.shellcheck",
14+
"ms-azuretools.vscode-docker",
15+
"redhat.vscode-yaml"
16+
]
17+
18+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19+
// "forwardPorts": [],
20+
21+
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
22+
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
23+
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
// "postCreateCommand": "uname -a",
26+
27+
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
28+
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
29+
30+
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
31+
// "remoteUser": "vscode"
32+
}

.vscode/settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"git.enableCommitSigning": true,
3+
4+
}

0 commit comments

Comments
 (0)