diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a908b43..57c9a2a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,8 +1,9 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/rust/.devcontainer/base.Dockerfile -# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye -ARG VARIANT="bullseye" -FROM mcr.microsoft.com/vscode/devcontainers/rust:1-${VARIANT} +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/debian/.devcontainer/base.Dockerfile -# [Optional] Uncomment this section to install additional packages. +# [Choice] Debian version (use bullseye on local arm64/Apple Silicon): bullseye, buster +ARG VARIANT="buster" +FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} + +# ** [Optional] Uncomment this section to install additional packages. ** # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # && apt-get -y install --no-install-recommends diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2bbd3bc..87f014f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ -// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/rust +// 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.245.0/containers/ubuntu { "name": "beteran-protobuf-rust", "build": { @@ -15,6 +15,10 @@ "--security-opt", "seccomp=unconfined" ], + // Use this environment variable if you need to bind mount your local source code into a new container. + "remoteEnv": { + "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" + }, // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. @@ -23,9 +27,6 @@ "settings": { "lldb.verboseLogging": true, "lldb.executable": "/usr/bin/lldb", - "search.exclude": { - "**/target": true - }, // VS Code don't watch files under ./target "files.watcherExclude": { "**/.git/objects/**": true, @@ -54,7 +55,12 @@ // 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 run as root instead. - "remoteUser": "vscode" + // "postCreateCommand": "uname -a", + "postCreateCommand": "bash ./.devcontainer/scripts/postCreateCommand.sh", + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode", + "features": { + "git": "latest", + "rust": "latest" + } } \ No newline at end of file diff --git a/.devcontainer/rust-toolchain.toml b/.devcontainer/rust-toolchain.toml index 9f03cc5..f249bf6 100644 --- a/.devcontainer/rust-toolchain.toml +++ b/.devcontainer/rust-toolchain.toml @@ -2,6 +2,4 @@ channel = "stable" profile = "minimal" components = ["clippy", "rustfmt"] -targets = [ - -] +targets = [] diff --git a/.devcontainer/scripts/postCreateCommand.sh b/.devcontainer/scripts/postCreateCommand.sh new file mode 100644 index 0000000..7e96b6b --- /dev/null +++ b/.devcontainer/scripts/postCreateCommand.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +set -e +