From 7793b3505d1dc4b6983bcc3c7efe8915dbc6150c Mon Sep 17 00:00:00 2001 From: Lukas <76838159+wolflu05@users.noreply.github.com> Date: Fri, 5 May 2023 14:34:42 +0200 Subject: [PATCH] Fix various devcontainer issues (#4761) * Fix various devcontainer issues - fix dubious git ownership during postCreateCommand - fix gpg signing in container - fix local gitconfig in container - add gitlens extension to devcontainer - enable plugins in devcontainer * fix: spelling mistake --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 6 ++++-- .devcontainer/postCreateCommand.sh | 8 ++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) mode change 100644 => 100755 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile old mode 100644 new mode 100755 index b252c260bc..aac3a70c16 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -16,7 +16,7 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/ # [Optional] Uncomment this section to install additional OS packages. RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && \ apt-get -y install --no-install-recommends \ - git gcc g++ gettext gnupg libffi-dev \ + git gcc g++ gettext gnupg2 libffi-dev \ # Weasyprint requirements : https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#debian-11 poppler-utils libpango-1.0-0 libpangoft2-1.0-0 \ # Image format support diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 65f10ec5eb..e25892222a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -40,7 +40,8 @@ "extensions": [ "ms-python.python", "ms-python.vscode-pylance", - "batisteo.vscode-django" + "batisteo.vscode-django", + "eamodio.gitlens" ] } }, @@ -74,13 +75,14 @@ "INVENTREE_BACKUP_DIR": "/workspaces/InvenTree/dev/backup", "INVENTREE_CONFIG_FILE": "/workspaces/InvenTree/dev/config.yaml", "INVENTREE_SECRET_KEY_FILE": "/workspaces/InvenTree/dev/secret_key.txt", + "INVENTREE_PLUGINS_ENABLED": "True", "INVENTREE_PLUGIN_DIR": "/workspaces/InvenTree/dev/plugins", "INVENTREE_PLUGIN_FILE": "/workspaces/InvenTree/dev/plugins.txt", // Python config "PIP_USER": "no", - // used to load the venv into the PATH and avtivate it + // used to load the venv into the PATH and activate it // Ref: https://stackoverflow.com/a/56286534 "VIRTUAL_ENV": "/workspaces/InvenTree/dev/venv", "PATH": "/workspaces/InvenTree/dev/venv/bin:${containerEnv:PATH}" diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 6eb2b5861e..29a964366e 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -8,7 +8,15 @@ cd /workspaces/InvenTree python3 -m venv dev/venv . dev/venv/bin/activate +# Avoiding Dubious Ownership in Dev Containers for setup commands that use git +git config --global --add safe.directory /workspaces/InvenTree + # setup InvenTree server pip install invoke inv update inv setup-dev + +# remove existing gitconfig created by "Avoiding Dubious Ownership" step +# so that it gets copyied from host to the container to have your global +# git config in container +rm -f /home/vscode/.gitconfig