chore: Update dev container configuration

Updates the dev container configuration to use the default Microsoft
supported rust environment.

Support for GUI rendering is also included for Linux hosts using
Wayland.
This commit is contained in:
deadmeu 2024-08-03 16:53:10 +10:00
parent 005e4a9649
commit 4636f06ede
No known key found for this signature in database
4 changed files with 67 additions and 35 deletions

View File

@ -1,12 +0,0 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/master/containers/ubuntu/.devcontainer/base.Dockerfile
# [Choice] Ubuntu version (use jammy or bionic on local arm64/Apple Silicon): jammy, focal, bionic
ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
# Derived from Tauri contribution and setup guides:
# See: https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#development-guide
# See: https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux
ARG TAURI_BUILD_DEPS="build-essential curl libappindicator3-dev libgtk-3-dev librsvg2-dev libssl-dev libwebkit2gtk-4.1-dev wget"
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y --no-install-recommends $TAURI_BUILD_DEPS

View File

@ -1,30 +1,48 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/ubuntu
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Ubuntu",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
"args": { "VARIANT": "ubuntu-22.04" }
},
"name": "Tauri",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/rust:1-1-bookworm",
// Set *default* container specific settings.json values on container create.
"settings": {},
"remoteEnv": {
"XDG_RUNTIME_DIR": "/tmp",
"WAYLAND_DISPLAY": "${localEnv:WAYLAND_DISPLAY}"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [],
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
"mounts": [
// Wayland
// TODO: ${containerEnv:} substitution currently broken (https://github.com/microsoft/vscode-remote-release/issues/10033)
// "source=/${localEnv:XDG_RUNTIME_DIR}/${localEnv:WAYLAND_DISPLAY},target=/${containerEnv:XDG_RUNTIME_DIR}/${containerEnv:WAYLAND_DISPLAY},readonly,type=bind",
"source=${localEnv:XDG_RUNTIME_DIR}/${localEnv:WAYLAND_DISPLAY},target=/tmp/${localEnv:WAYLAND_DISPLAY},readonly,type=bind"
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// X11
// TODO: does not work
// "source=/tmp/.X11-unix,target=/tmp/.X11-unix,readonly,type=bind"
],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"node": "lts",
"rust": "latest"
}
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
"runArgs": [
"--userns=keep-id"
],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"tauri-apps.tauri-vscode"
]
}
},
"containerUser": "vscode"
}

View File

@ -0,0 +1,14 @@
#!/bin/sh
sudo apt update && sudo apt install -y --no-install-recommends \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
cargo install tauri-cli@^2.0.0-beta

12
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot
version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly