From b40e0dd4a1d8d4d3e309baf65bade2ab7d4589f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20L=C3=BCscher?= Date: Mon, 13 May 2024 08:41:12 +0000 Subject: [PATCH] chore(devcontainer): add connection from devcontainer to docker registry (#43) --- .devcontainer/devcontainer.json | 2 ++ .devcontainer/install-dev-tools.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9ab7b13..12984db 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -16,6 +16,8 @@ "version": "1.8.2" } }, + // Additional arguments when starting the container + "runArgs": ["--add-host=host.docker.internal:host-gateway"], // Create symbolic link for forge data dir mount "initializeCommand": "${localWorkspaceFolder}/.devcontainer/prepare_mount.sh", // Container user definition - This is needed for compatibility with podman -> https://github.com/containers/podman/issues/15001#issuecomment-1193321924 diff --git a/.devcontainer/install-dev-tools.sh b/.devcontainer/install-dev-tools.sh index eac5b14..435450f 100644 --- a/.devcontainer/install-dev-tools.sh +++ b/.devcontainer/install-dev-tools.sh @@ -4,6 +4,20 @@ YELLOW="\e[33m" GREEN="\e[32m" ENDCOLOR="\e[0m" +# Add Forge DEV DNS entries +echo "" +echo -e "${YELLOW}Adding DNS entries for ublue.local${ENDCOLOR}" +echo "" +DOCKER_HOST=$(getent hosts host.docker.internal | awk '{ print $1 }') +echo "$DOCKER_HOST registry.ublue.local" | sudo tee -a /etc/hosts + +## Install SSL certificates +echo "" +echo -e "${YELLOW}Installing SSL certificates${ENDCOLOR}" +echo "" +sudo cp /data/ublue-os_forge-root.pem /usr/local/share/ca-certificates/ublue-os_forge-root.crt +sudo update-ca-certificates --fresh + ## Update system echo "" echo -e "${YELLOW}Updating OS${ENDCOLOR}"