Skip to content

Commit 5e5929a

Browse files
authored
Add devcontainer (#357)
Add a `.devcontainer` folder to help with Linux development and testing while on other platforms. In VS Code choose `Dev Containers: Reopen in Container` to reopen Swiftly in the dev container.
1 parent 071ebf1 commit 5e5929a

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM swift:6.1-jammy
2+
3+
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
4+
&& apt-get -q update \
5+
&& apt-get -q dist-upgrade -y \
6+
&& apt-get -q install -y \
7+
curl \
8+
sqlite3 \
9+
libsqlite3-dev \
10+
libncurses5-dev \
11+
python3 \
12+
build-essential \
13+
libarchive-dev

.devcontainer/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "Swiftly",
3+
"dockerFile": "Dockerfile",
4+
"features": {
5+
"ghcr.io/devcontainers/features/common-utils:2": {
6+
"installZsh": "false",
7+
"username": "swiftly",
8+
"userUid": "1000",
9+
"userGid": "1000",
10+
"upgradePackages": "false"
11+
},
12+
"ghcr.io/devcontainers/features/git:1": {
13+
"version": "os-provided",
14+
"ppa": "false"
15+
}
16+
},
17+
// Configure tool-specific properties.
18+
"customizations": {
19+
// Configure properties specific to VS Code.
20+
"vscode": {
21+
// Add the IDs of extensions you want installed when the container is created.
22+
"extensions": [
23+
"swiftlang.swift-vscode"
24+
]
25+
}
26+
},
27+
"runArgs": [
28+
"--cap-add=SYS_PTRACE",
29+
"--security-opt",
30+
"seccomp=unconfined"
31+
],
32+
"mounts": [
33+
],
34+
// Use 'postCreateCommand' to run commands after the container is created.
35+
"postCreateCommand": "echo OK",
36+
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
37+
"remoteUser": "swiftly"
38+
}

0 commit comments

Comments
 (0)