From 74cb70590c1b50d8f9bbaf82411e6c3c8a8223e0 Mon Sep 17 00:00:00 2001 From: stephenandary Date: Sat, 29 Apr 2023 11:44:28 -0400 Subject: [PATCH 1/6] WIP - Initial commit of devcontainer --- .devcontainer/devcontainer.json | 28 +++++++++++++++++++ .../linux/devcontainer-feature.json | 4 +++ .devcontainer/local-features/linux/install.sh | 6 ++++ 3 files changed, 38 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/local-features/linux/devcontainer-feature.json create mode 100644 .devcontainer/local-features/linux/install.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..1c5278332 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,28 @@ +{ + "name": "dioxus", + "image": "mcr.microsoft.com/devcontainers/rust:latest", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": {}, + "./local-features/linux": {} + }, + "containerEnv": { + "RUST_LOG": "INFO" + }, + "customizations": { + "vscode": { + "settings": { + "files.watcherExclude": { + "**/target/**": true + }, + "[rust]": { + "editor.formatOnSave": true + } + }, + "extensions": [ + "rust-lang.rust-analyzer", + "tamasfe.even-better-toml", + "serayuzgur.crates" + ] + } + } +} \ No newline at end of file diff --git a/.devcontainer/local-features/linux/devcontainer-feature.json b/.devcontainer/local-features/linux/devcontainer-feature.json new file mode 100644 index 000000000..daba5bc1f --- /dev/null +++ b/.devcontainer/local-features/linux/devcontainer-feature.json @@ -0,0 +1,4 @@ +{ + "id": "linux", + "version": "0.0.1" +} \ No newline at end of file diff --git a/.devcontainer/local-features/linux/install.sh b/.devcontainer/local-features/linux/install.sh new file mode 100644 index 000000000..8f9ad5e1a --- /dev/null +++ b/.devcontainer/local-features/linux/install.sh @@ -0,0 +1,6 @@ +#!/bin/bash +echo "Update Apt Database" +sudo apt-get update + +echo "Install Webkit Dependencies" +sudo apt-get -qq install build-essential libwebkit2gtk-4.0-dev libgtk-3-dev libayatana-appindicator3-dev From a78ee4ffe77ad68a2b6e677446853bef3b086584 Mon Sep 17 00:00:00 2001 From: stephenandary Date: Mon, 1 May 2023 14:12:08 -0400 Subject: [PATCH 2/6] WIP - Update devcontainer to use debian bookworm --- .devcontainer/Dockerfile | 9 +++++++++ .devcontainer/devcontainer.json | 15 ++++++++++++--- .../linux/devcontainer-feature.json | 4 ---- .devcontainer/local-features/linux/install.sh | 6 ------ 4 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/local-features/linux/devcontainer-feature.json delete mode 100644 .devcontainer/local-features/linux/install.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..b20e962b9 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,9 @@ +# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye +ARG VARIANT="slim-bookworm" +FROM rust:${VARIANT} +ENV DEBIAN_FRONTEND noninteractive +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive + +RUN apt-get -qq install build-essential libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1c5278332..aa536ab53 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,9 +1,18 @@ { "name": "dioxus", - "image": "mcr.microsoft.com/devcontainers/rust:latest", + "remoteUser": "vscode", + "build": { + "dockerfile": "./Dockerfile", + "context": "." + }, "features": { - "ghcr.io/devcontainers/features/common-utils:2": {}, - "./local-features/linux": {} + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "true", + "username": "vscode", + "uid": "1000", + "gid": "1000", + "upgradePackages": "true" + } }, "containerEnv": { "RUST_LOG": "INFO" diff --git a/.devcontainer/local-features/linux/devcontainer-feature.json b/.devcontainer/local-features/linux/devcontainer-feature.json deleted file mode 100644 index daba5bc1f..000000000 --- a/.devcontainer/local-features/linux/devcontainer-feature.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "id": "linux", - "version": "0.0.1" -} \ No newline at end of file diff --git a/.devcontainer/local-features/linux/install.sh b/.devcontainer/local-features/linux/install.sh deleted file mode 100644 index 8f9ad5e1a..000000000 --- a/.devcontainer/local-features/linux/install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -echo "Update Apt Database" -sudo apt-get update - -echo "Install Webkit Dependencies" -sudo apt-get -qq install build-essential libwebkit2gtk-4.0-dev libgtk-3-dev libayatana-appindicator3-dev From 856650eb4d4c898af323fa4750e0a1bf2db9ac6a Mon Sep 17 00:00:00 2001 From: stephenandary Date: Mon, 1 May 2023 14:25:54 -0400 Subject: [PATCH 3/6] WIP - Add README --- .devcontainer/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .devcontainer/README.md diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 000000000..74dbbe8c5 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,26 @@ +# Dev Container + +A dev container in the most simple context allows one to create a consistent development environment within a docker container that can easily be opened locally or remotely via codespaces such that contributors don't need to install anything to contribute. + +## Useful Links + +- +- +- +- + +## Using A Dev Container + +### Locally + +To use this dev container locally, make sure Docker is installed and in VSCode install the `ms-vscode-remote.remote-containers` extension. Then from the root of Dioxus you can type `Ctrl + Shift + P`, then choose `Dev Containers: Rebuild and Reopen in Devcontainer`. + +### Codespaces + +TBD + +## Troubleshooting + +If having difficulty commiting with github, and you use ssh or gpg keys, you may need to ensure that the keys are being shared properly between your host and VSCode. + +Though VSCode does a pretty good job sharing credentials between host and devcontainer, to save some time you can always just reopen the container locally to commit with `Ctrl + Shift + P`, then choose `Dev Containers: Reopen Folder Locally` From e68c806f8ce294cc855c116db3a2ba0d26cc6bd3 Mon Sep 17 00:00:00 2001 From: stephenandary Date: Mon, 1 May 2023 14:27:47 -0400 Subject: [PATCH 4/6] WIP - Update Readme Codespaces section with setup link --- .devcontainer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 74dbbe8c5..570435663 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -17,7 +17,7 @@ To use this dev container locally, make sure Docker is installed and in VSCode i ### Codespaces -TBD +[Codespaces Setup](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository) ## Troubleshooting From 5f3c3d3f04217fcd1d58b5a182ee19dfba369037 Mon Sep 17 00:00:00 2001 From: stephenandary Date: Mon, 1 May 2023 14:49:38 -0400 Subject: [PATCH 5/6] WIP - Update base image to nightly so format on save works --- .devcontainer/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b20e962b9..c0e58fab8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ # [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye -ARG VARIANT="slim-bookworm" -FROM rust:${VARIANT} +ARG VARIANT="nightly-bookworm-slim" +FROM rustlang/rust:${VARIANT} ENV DEBIAN_FRONTEND noninteractive RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections From d3cf9f728c6d501944c143baa1e39d77ac9b0f45 Mon Sep 17 00:00:00 2001 From: stephenandary Date: Mon, 1 May 2023 14:54:21 -0400 Subject: [PATCH 6/6] WIP - remove comment in Dockerfile --- .devcontainer/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c0e58fab8..e2fd03ad8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,3 @@ -# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye ARG VARIANT="nightly-bookworm-slim" FROM rustlang/rust:${VARIANT} ENV DEBIAN_FRONTEND noninteractive