Skip to content

Commit f506311

Browse files
authored
Include latest changes from vscode-dev-containers (#6)
* Include latest changes from vscode-dev-containers * tabbing
1 parent 29336c1 commit f506311

File tree

5 files changed

+31
-30
lines changed

5 files changed

+31
-30
lines changed

src/swift/.devcontainer/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# [Choice] Swift version: 5.5, 5.4, 5.3, 5.2, 5.1, 4.2
2-
ARG VARIANT=5.5
1+
# [Choice] Swift version: 5.6-focal, 5.5, 5.4, 5.3, 5.2, 5.1, 4.2
2+
ARG VARIANT=${templateOption:imageVariant}
33
FROM swift:${VARIANT}
44

55
# [Option] Install zsh
6-
ARG INSTALL_ZSH="true"
6+
ARG INSTALL_ZSH="${templateOption:installZsh}"
77
# [Option] Upgrade OS packages to their latest versions
8-
ARG UPGRADE_PACKAGES="false"
8+
ARG UPGRADE_PACKAGES="${templateOption:upgradePackages}"
99

1010
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
1111
ARG USERNAME=vscode
@@ -17,7 +17,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1717
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/library-scripts
1818

1919
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
20-
ARG NODE_VERSION="none"
20+
ARG NODE_VERSION="${templateOption:nodeVersion}"
2121
ENV NVM_DIR=/usr/local/share/nvm
2222
ENV NVM_SYMLINK_CURRENT=true \
2323
PATH=${NVM_DIR}/current/bin:${PATH}
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
{
22
"name": "Swift (Community)",
33
"build": {
4-
"dockerfile": "Dockerfile",
5-
"args": {
6-
// Update the VARIANT arg to pick a Swift version
7-
"VARIANT": "5.7",
8-
// Options
9-
"NODE_VERSION": "lts/*"
10-
}
4+
"dockerfile": "Dockerfile"
115
},
126
"runArgs": [
137
"--cap-add=SYS_PTRACE",
148
"--security-opt",
159
"seccomp=unconfined"
1610
],
1711

18-
// Set *default* container specific settings.json values on container create.
19-
"settings": {
20-
"lldb.library": "/usr/lib/liblldb.so"
21-
},
22-
23-
// Add the IDs of extensions you want installed when the container is created.
24-
"extensions": [
25-
"sswg.swift-lang"
26-
],
12+
// Configure tool-specific properties.
13+
"customizations": {
14+
// Configure properties specific to VS Code.
15+
"vscode": {
16+
// Set *default* container specific settings.json values on container create.
17+
"settings": {
18+
"lldb.library": "/usr/lib/liblldb.so"
19+
},
20+
21+
// Add the IDs of extensions you want installed when the container is created.
22+
"extensions": [
23+
"sswg.swift-lang"
24+
]
25+
}
26+
},
2727

2828
// Use 'forwardPorts' to make a list of ports inside the container available locally.
2929
// "forwardPorts": [],
3030

3131
// Use 'postCreateCommand' to run commands after the container is created.
3232
// "postCreateCommand": "",
3333

34-
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
34+
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
3535
"remoteUser": "vscode"
3636
}

src/swift/.devcontainer/library-scripts/common-debian.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
102102
libkrb5-3 \
103103
libgssapi-krb5-2 \
104104
libicu[0-9][0-9] \
105-
liblttng-ust0 \
105+
liblttng-ust[0-9] \
106106
libstdc++6 \
107107
zlib1g \
108108
locales \
@@ -205,7 +205,7 @@ else
205205
fi
206206
fi
207207

208-
# Add add sudo support for non-root user
208+
# Add sudo support for non-root user
209209
if [ "${USERNAME}" != "root" ] && [ "${EXISTING_NON_ROOT_USER}" != "${USERNAME}" ]; then
210210
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
211211
chmod 0440 /etc/sudoers.d/$USERNAME
@@ -287,7 +287,7 @@ cat << 'EOF' > /usr/local/bin/systemctl
287287
#!/bin/sh
288288
set -e
289289
if [ -d "/run/systemd/system" ]; then
290-
exec /bin/systemctl/systemctl "$@"
290+
exec /bin/systemctl "$@"
291291
else
292292
echo '\n"systemd" is not running in this container due to its overhead.\nUse the "service" command to start services instead. e.g.: \n\nservice --status-all'
293293
fi

src/swift/.devcontainer/library-scripts/node-debian.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF
126126
umask 0002
127127
# Do not update profile - we'll do this manually
128128
export PROFILE=/dev/null
129+
ls -lah /home/${USERNAME}/.nvs || :
129130
curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash
130131
source ${NVM_DIR}/nvm.sh
131132
if [ "${NODE_VERSION}" != "" ]; then

src/swift/devcontainer-template.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
"description": "Node.js version:",
3737
"proposals": [
3838
"none",
39-
"lts/*",
39+
"lts",
40+
"latest",
41+
"18",
4042
"16",
41-
"14",
42-
"12",
43-
"10"
43+
"14"
4444
],
45-
"default": "lts/*"
45+
"default": "lts"
4646
}
4747
},
4848
"platforms": [

0 commit comments

Comments
 (0)