Skip to content

Commit 7b3612b

Browse files
committed
Add VS Code container
1 parent e3c2a62 commit 7b3612b

File tree

4 files changed

+693
-0
lines changed

4 files changed

+693
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# [Choice] Swift version:
2+
ARG VARIANT=6.0.3-jammy
3+
FROM swift:${VARIANT}
4+
5+
# [Option] Install zsh
6+
ARG INSTALL_ZSH="true"
7+
# [Option] Upgrade OS packages to their latest versions
8+
ARG UPGRADE_PACKAGES="false"
9+
10+
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
11+
ARG USERNAME=vscode
12+
ARG USER_UID=1000
13+
ARG USER_GID=$USER_UID
14+
COPY library-scripts/common-debian.sh /tmp/library-scripts/
15+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
16+
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
17+
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/library-scripts
18+
19+
# Install Cairo
20+
RUN export DEBIAN_FRONTEND=noninteractive \
21+
&& apt-get update \
22+
&& apt-get install -y \
23+
libsdl2-dev \
24+
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*

.devcontainer/devcontainer.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/swift
3+
{
4+
"name": "Swift",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Update the VARIANT arg to pick a Swift version
9+
"VARIANT": "6.0.3-jammy",
10+
// Options
11+
"NODE_VERSION": "lts/*",
12+
"UPGRADE_PACKAGES": "true"
13+
}
14+
},
15+
"runArgs": [
16+
"--cap-add=SYS_PTRACE",
17+
"--security-opt",
18+
"seccomp=unconfined"
19+
],
20+
21+
// Configure tool-specific properties.
22+
"customizations": {
23+
// Configure properties specific to VS Code.
24+
"vscode": {
25+
// Set *default* container specific settings.json values on container create.
26+
"settings": {
27+
"lldb.library": "/usr/lib/liblldb.so"
28+
},
29+
30+
// Add the IDs of extensions you want installed when the container is created.
31+
"extensions": [
32+
"sswg.swift-lang"
33+
]
34+
}
35+
},
36+
37+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
38+
// "forwardPorts": [],
39+
40+
// Use 'postCreateCommand' to run commands after the container is created.
41+
// "postCreateCommand": "",
42+
43+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
44+
"remoteUser": "vscode"
45+
}

0 commit comments

Comments
 (0)