From 1159915ffb22968be19341c64b795feb0c7364e1 Mon Sep 17 00:00:00 2001 From: Artur Tynecki <77382963+ATmobica@users.noreply.github.com> Date: Tue, 16 May 2023 16:52:06 +0200 Subject: [PATCH] [devcontainer] Standalone build and update (#26511) * [vscode] Make the devcontainer image build a standalone script This enable us to set --net=host for the image creation. This should avoid dns restrictions one may have on one's local network by giving the image the same network as the host. This is only for the image build, not for running the container. Signed-off-by: Yoan Picchi * [vscode] Update dev container configuration - Move deprecated configuration into correct section - Add mcu-debug.debug-tracker-vscode into extension list. This extension is required for cortex debug. Signed-off-by: Vincent Coubard --------- Signed-off-by: Yoan Picchi Signed-off-by: Vincent Coubard Co-authored-by: Vincent Coubard --- .devcontainer/build.sh | 85 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 67 ++++++++++++++------------ 2 files changed, 121 insertions(+), 31 deletions(-) create mode 100755 .devcontainer/build.sh diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh new file mode 100755 index 00000000000000..761d911ef4467e --- /dev/null +++ b/.devcontainer/build.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +# +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +HERE="$(dirname "$0")" +CHIP_ROOT="$(realpath "$HERE"/..)" +BUILD_VERSION="latest" +IMAGE_TAG="matter-dev-environment:local" +USER_UID=$UID + +function show_usage() { + cat < Preferences > Settings > Remote. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash" + "customizations": { + "vscode": { + // Add the IDs of extensions you want installed when the container is created in the array below. + "extensions": [ + "mcu-debug.debug-tracker-vscode", + "aaron-bond.better-comments", + "augustocdias.tasks-shell-input", + "christian-kohler.path-intellisense", + "eamodio.gitlens", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "foxundermoon.shell-format", + "github.vscode-pull-request-github", + "maelvalais.autoconf", + "marus25.cortex-debug", + "ms-azuretools.vscode-docker", + "ms-vscode.cpptools", + "msedge-dev.gnls", + "redhat.vscode-yaml", + "vadimcn.vscode-lldb", + "xaver.clang-format", + "yuichinukiyama.vscode-preview-server", + "yzhang.markdown-all-in-one" + ], + "settings": { + "terminal.integrated.defaultProfile.linux": "bash", + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/bin/bash", + "args": ["-l"] + } + } + } + } }, "remoteEnv": { "GIT_PS1_SHOWDIRTYSTATE": "1",