Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/swift/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# [Choice] Swift version: 5.5, 5.4, 5.3, 5.2, 5.1, 4.2
ARG VARIANT=5.5
# [Choice] Swift version: 5.6-focal, 5.5, 5.4, 5.3, 5.2, 5.1, 4.2
ARG VARIANT=${templateOption:imageVariant}
FROM swift:${VARIANT}

# [Option] Install zsh
ARG INSTALL_ZSH="true"
ARG INSTALL_ZSH="${templateOption:installZsh}"
# [Option] Upgrade OS packages to their latest versions
ARG UPGRADE_PACKAGES="false"
ARG UPGRADE_PACKAGES="${templateOption:upgradePackages}"

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

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
ARG NODE_VERSION="${templateOption:nodeVersion}"
ENV NVM_DIR=/usr/local/share/nvm
ENV NVM_SYMLINK_CURRENT=true \
PATH=${NVM_DIR}/current/bin:${PATH}
Expand Down
34 changes: 17 additions & 17 deletions src/swift/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{
"name": "Swift (Community)",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a Swift version
"VARIANT": "5.7",
// Options
"NODE_VERSION": "lts/*"
}
"dockerfile": "Dockerfile"
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],

// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
]
}
},

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

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

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
6 changes: 3 additions & 3 deletions src/swift/.devcontainer/library-scripts/common-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
libkrb5-3 \
libgssapi-krb5-2 \
libicu[0-9][0-9] \
liblttng-ust0 \
liblttng-ust[0-9] \
libstdc++6 \
zlib1g \
locales \
Expand Down Expand Up @@ -205,7 +205,7 @@ else
fi
fi

# Add add sudo support for non-root user
# Add sudo support for non-root user
if [ "${USERNAME}" != "root" ] && [ "${EXISTING_NON_ROOT_USER}" != "${USERNAME}" ]; then
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
chmod 0440 /etc/sudoers.d/$USERNAME
Expand Down Expand Up @@ -287,7 +287,7 @@ cat << 'EOF' > /usr/local/bin/systemctl
#!/bin/sh
set -e
if [ -d "/run/systemd/system" ]; then
exec /bin/systemctl/systemctl "$@"
exec /bin/systemctl "$@"
else
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'
fi
Expand Down
1 change: 1 addition & 0 deletions src/swift/.devcontainer/library-scripts/node-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF
umask 0002
# Do not update profile - we'll do this manually
export PROFILE=/dev/null
ls -lah /home/${USERNAME}/.nvs || :
curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash
source ${NVM_DIR}/nvm.sh
if [ "${NODE_VERSION}" != "" ]; then
Expand Down
10 changes: 5 additions & 5 deletions src/swift/devcontainer-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"description": "Node.js version:",
"proposals": [
"none",
"lts/*",
"lts",
"latest",
"18",
"16",
"14",
"12",
"10"
"14"
],
"default": "lts/*"
"default": "lts"
}
},
"platforms": [
Expand Down