From 82c1af3e127d8cc8c23002fa1fdbbdbdacb8c664 Mon Sep 17 00:00:00 2001 From: "Emrich Oliver (ETAS)" Date: Tue, 4 Nov 2025 15:49:50 +0000 Subject: [PATCH 1/8] docs: Corrected documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1f10fe..9fc0295 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ It is very simple to develop the development container. You can change files related to the container and then simply run the `scripts/*`. They are used by the CI, but especially the build and test scripts can be run also locally out of the box: ````console -$ ./scripts/build.sh +$ ./scripts/build.sh [labels] [... build output..] {"outcome":"success","imageName":["ghcr.io/eclipse-score/devcontainer"]} From c287345d8c068a73cd2bb44e9323c43022abb8f9 Mon Sep 17 00:00:00 2001 From: "Emrich Oliver (ETAS)" Date: Wed, 5 Nov 2025 14:05:07 +0000 Subject: [PATCH 2/8] Introduced usage of proxy environment variables --- .../.devcontainer/Dockerfile | 17 ++ .../.devcontainer/devcontainer.json | 33 ++- .../.devcontainer/setup-proxy.sh | 218 ++++++++++++++++++ 3 files changed, 267 insertions(+), 1 deletion(-) create mode 100755 src/s-core-devcontainer/.devcontainer/setup-proxy.sh diff --git a/src/s-core-devcontainer/.devcontainer/Dockerfile b/src/s-core-devcontainer/.devcontainer/Dockerfile index b281a62..13b0277 100644 --- a/src/s-core-devcontainer/.devcontainer/Dockerfile +++ b/src/s-core-devcontainer/.devcontainer/Dockerfile @@ -1,6 +1,23 @@ ARG VARIANT="noble" + +# Proxy arguments for build-time network access +ARG HTTP_PROXY +ARG HTTPS_PROXY +ARG http_proxy +ARG https_proxy +ARG NO_PROXY +ARG no_proxy + FROM buildpack-deps:${VARIANT}-curl +# Set proxy environment variables for the build process +ENV HTTP_PROXY=${HTTP_PROXY} +ENV HTTPS_PROXY=${HTTPS_PROXY} +ENV http_proxy=${http_proxy} +ENV https_proxy=${https_proxy} +ENV NO_PROXY=${NO_PROXY} +ENV no_proxy=${no_proxy} + LABEL dev.containers.features="common" ARG VARIANT diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer.json b/src/s-core-devcontainer/.devcontainer/devcontainer.json index 8a0e60b..bf649e4 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer.json @@ -2,7 +2,15 @@ "build": { // Installs latest version from the Distribution "dockerfile": "./Dockerfile", - "context": "." + "context": ".", + "args": { + "HTTP_PROXY": "${localEnv:HTTP_PROXY}", + "HTTPS_PROXY": "${localEnv:HTTPS_PROXY}", + "http_proxy": "${localEnv:http_proxy}", + "https_proxy": "${localEnv:https_proxy}", + "NO_PROXY": "${localEnv:NO_PROXY}", + "no_proxy": "${localEnv:no_proxy}" + } }, "features": { "ghcr.io/devcontainers/features/common-utils": { @@ -40,6 +48,29 @@ "./s-core-local" ], "remoteUser": "vscode", + "runArgs": [ + "--add-host=host.docker.internal:host-gateway", + "--shm-size=16g", + "--cap-add=SYS_PTRACE", + "--cap-add=SYS_NICE", + "--ulimit=rtprio=99", + "--ulimit=nice=-20", + "--security-opt=seccomp=unconfined", + "--env=HTTP_PROXY", + "--env=HTTPS_PROXY", + "--env=http_proxy", + "--env=https_proxy", + "--env=NO_PROXY", + "--env=no_proxy", + "--env=DISPLAY", + "--env=WORKSPACE_FOLDER=/workspace", + "--volume=/var/run/docker.sock:/var/run/docker.sock", + "--volume=..:/workspace:cached", + "--volume=/tmp/.X11-unix:/tmp/.X11-unix", + "--volume=/home/${USER}/.cache/uv:/home/user/.cache/uv" + ], + "workspaceFolder": "/workspace", + "postCreateCommand": "bash .devcontainer/setup-proxy.sh", "customizations": { "vscode": { "extensions": [ diff --git a/src/s-core-devcontainer/.devcontainer/setup-proxy.sh b/src/s-core-devcontainer/.devcontainer/setup-proxy.sh new file mode 100755 index 0000000..7b44a40 --- /dev/null +++ b/src/s-core-devcontainer/.devcontainer/setup-proxy.sh @@ -0,0 +1,218 @@ +#!/bin/bash + +# Post-create script to configure Docker daemon with proxy settings +# This script will run automatically when the devcontainer is created + +set -e + +echo "๐Ÿ”ง Setting up Docker daemon with proxy configuration..." + +# Check if any proxy variables are set +if [[ -n "${HTTP_PROXY:-}" || -n "${HTTPS_PROXY:-}" || -n "${http_proxy:-}" || -n "${https_proxy:-}" ]]; then + echo "๐Ÿ“ก Proxy environment detected, configuring Docker daemon..." + + # Create systemd service directory for Docker + sudo mkdir -p /etc/systemd/system/docker.service.d + + # Create Docker daemon proxy configuration + sudo tee /etc/systemd/system/docker.service.d/http-proxy.conf > /dev/null << EOF +[Service] +Environment="HTTP_PROXY=${HTTP_PROXY:-}" +Environment="HTTPS_PROXY=${HTTPS_PROXY:-}" +Environment="http_proxy=${http_proxy:-}" +Environment="https_proxy=${https_proxy:-}" +Environment="NO_PROXY=${NO_PROXY:-localhost,127.0.0.1,docker-registry.example.com,.corp}" +Environment="no_proxy=${no_proxy:-localhost,127.0.0.1,docker-registry.example.com,.corp}" +EOF + + # Create Docker daemon configuration + sudo mkdir -p /etc/docker + sudo tee /etc/docker/daemon.json > /dev/null << EOF +{ + "registry-mirrors": [], + "insecure-registries": [], + "debug": false, + "experimental": false, + "dns": ["8.8.8.8", "1.1.1.1"], + "dns-search": [], + "dns-opts": [] +} +EOF + + # Create Docker client proxy configuration for the user + mkdir -p ~/.docker + tee ~/.docker/config.json > /dev/null << EOF +{ + "proxies": { + "default": { + "httpProxy": "${HTTP_PROXY:-}", + "httpsProxy": "${HTTPS_PROXY:-}", + "noProxy": "${NO_PROXY:-localhost,127.0.0.1}" + } + } +} +EOF + + # Function to restart Docker daemon with proxy settings + restart_docker_with_proxy() { + echo "๐Ÿ”„ Restarting Docker daemon with proxy settings..." + + # Kill existing dockerd if running + if pgrep dockerd > /dev/null; then + echo "Stopping existing Docker daemon..." + sudo pkill dockerd || true + sleep 3 + fi + + # Start Docker daemon with proxy environment variables + echo "Starting Docker daemon with proxy configuration..." + sudo HTTP_PROXY="${HTTP_PROXY:-}" HTTPS_PROXY="${HTTPS_PROXY:-}" \ + http_proxy="${http_proxy:-}" https_proxy="${https_proxy:-}" \ + NO_PROXY="${NO_PROXY:-}" no_proxy="${no_proxy:-}" \ + dockerd --config-file /etc/docker/daemon.json > /dev/null 2>&1 & + + # Wait for Docker to start + echo "Waiting for Docker daemon to start..." + for i in {1..30}; do + if docker info > /dev/null 2>&1; then + echo "โœ… Docker daemon started successfully" + break + fi + echo "Waiting for Docker daemon... ($i/30)" + sleep 2 + done + + # Verify Docker is working + if ! docker info > /dev/null 2>&1; then + echo "โŒ Failed to start Docker daemon, trying alternative approach..." + + # Try without config file + sudo pkill dockerd > /dev/null 2>&1 || true + sleep 2 + sudo HTTP_PROXY="${HTTP_PROXY:-}" HTTPS_PROXY="${HTTPS_PROXY:-}" \ + http_proxy="${http_proxy:-}" https_proxy="${https_proxy:-}" \ + NO_PROXY="${NO_PROXY:-}" no_proxy="${no_proxy:-}" \ + dockerd > /dev/null 2>&1 & + + sleep 5 + if ! docker info > /dev/null 2>&1; then + echo "โŒ Failed to start Docker daemon" + return 1 + fi + fi + + # Verify proxy settings are applied + if docker info | grep -q "HTTP Proxy\|HTTPS Proxy"; then + echo "โœ… Proxy settings successfully applied to Docker daemon" + else + echo "โš ๏ธ Proxy settings may not be fully applied, but Docker is working" + fi + } + + # Restart Docker with proxy settings + restart_docker_with_proxy + + # Configure BuildKit with proxy + echo "๐Ÿ—๏ธ Configuring BuildKit with proxy settings..." + + # Remove existing multiarch builder if it exists + docker buildx rm multiarch 2>/dev/null || true + + # Prepare buildx command with proxy options + BUILDX_CMD="docker buildx create --name multiarch --driver docker-container --driver-opt network=host" + + # Add proxy environment variables only if they are set and non-empty + if [[ -n "${HTTP_PROXY:-}" ]]; then + BUILDX_CMD="$BUILDX_CMD --driver-opt env.HTTP_PROXY=${HTTP_PROXY}" + fi + + if [[ -n "${HTTPS_PROXY:-}" ]]; then + BUILDX_CMD="$BUILDX_CMD --driver-opt env.HTTPS_PROXY=${HTTPS_PROXY}" + fi + + if [[ -n "${http_proxy:-}" ]]; then + BUILDX_CMD="$BUILDX_CMD --driver-opt env.http_proxy=${http_proxy}" + fi + + if [[ -n "${https_proxy:-}" ]]; then + BUILDX_CMD="$BUILDX_CMD --driver-opt env.https_proxy=${https_proxy}" + fi + + # Add NO_PROXY only if set + if [[ -n "${NO_PROXY:-}" ]]; then + BUILDX_CMD="$BUILDX_CMD --driver-opt env.NO_PROXY=${NO_PROXY}" + fi + + if [[ -n "${no_proxy:-}" ]]; then + BUILDX_CMD="$BUILDX_CMD --driver-opt env.no_proxy=${no_proxy}" + fi + + # Execute the buildx command + eval $BUILDX_CMD + + # Use the new builder + docker buildx use multiarch + + # Bootstrap the builder + echo "๐Ÿš€ Bootstrapping BuildKit instance..." + docker buildx inspect --bootstrap + + echo "โœ… Docker and BuildKit configured with proxy settings" + +else + echo "๐ŸŒ No proxy environment detected, using default Docker configuration..." + + # Start Docker daemon if not running + if ! pgrep dockerd > /dev/null; then + echo "๐Ÿ”„ Starting Docker daemon..." + sudo dockerd > /dev/null 2>&1 & + + # Wait for Docker to start + for i in {1..30}; do + if docker info > /dev/null 2>&1; then + echo "โœ… Docker daemon started successfully" + break + fi + echo "Waiting for Docker daemon... ($i/30)" + sleep 2 + done + + if ! docker info > /dev/null 2>&1; then + echo "โŒ Failed to start Docker daemon" + exit 1 + fi + fi + + # Ensure basic Docker configuration exists + sudo mkdir -p /etc/docker + if [[ ! -f /etc/docker/daemon.json ]]; then + sudo tee /etc/docker/daemon.json > /dev/null << EOF +{ + "registry-mirrors": [], + "insecure-registries": [], + "debug": false, + "experimental": false +} +EOF + fi + + # Set up basic BuildKit if not already configured + if ! docker buildx ls | grep -q multiarch; then + echo "๐Ÿ—๏ธ Setting up default BuildKit configuration..." + docker buildx create --name multiarch --driver docker-container --use + docker buildx inspect --bootstrap + fi + + echo "โœ… Default Docker configuration applied" +fi + +# Verify everything is working +echo "๐Ÿงช Testing Docker functionality..." +if docker run --rm hello-world > /dev/null 2>&1; then + echo "โœ… Docker is working correctly" +else + echo "โŒ Docker test failed" + exit 1 +fi + +echo "๐ŸŽ‰ Docker setup completed successfully!" From 63979a7114bbeaa7cb071d2e67af1f953bbf7e15 Mon Sep 17 00:00:00 2001 From: "Emrich Oliver (ETAS)" Date: Tue, 11 Nov 2025 13:18:52 +0000 Subject: [PATCH 3/8] feat: Added proxy related functions to the create_builder.sh script --- scripts/create_builder.sh | 82 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 4 deletions(-) diff --git a/scripts/create_builder.sh b/scripts/create_builder.sh index 55a22a2..a8449e8 100755 --- a/scripts/create_builder.sh +++ b/scripts/create_builder.sh @@ -1,8 +1,82 @@ #!/usr/bin/env bash set -euxo pipefail -if ! docker buildx inspect multiarch &>/dev/null; then - docker buildx create --name multiarch --driver docker-container --use -else - docker buildx use multiarch +# Function to check if builder has correct proxy configuration +check_proxy_config() { + local builder_info + builder_info=$(docker buildx inspect multiarch 2>/dev/null || echo "") + + # Check if HTTP_PROXY is set in environment but not in builder + if [ -n "${HTTP_PROXY:-}" ]; then + if ! echo "$builder_info" | grep -q "HTTP_PROXY=${HTTP_PROXY}"; then + return 1 + fi + fi + + # Check if HTTPS_PROXY is set in environment but not in builder + if [ -n "${HTTPS_PROXY:-}" ]; then + if ! echo "$builder_info" | grep -q "HTTPS_PROXY=${HTTPS_PROXY}"; then + return 1 + fi + fi + + return 0 +} + +# Check if builder exists and has correct proxy configuration +if docker buildx inspect multiarch &>/dev/null; then + if ! check_proxy_config; then + echo "Builder 'multiarch' exists but has incorrect proxy configuration. Recreating..." + docker buildx rm multiarch + else + echo "Builder 'multiarch' already exists with correct configuration." + docker buildx use multiarch + exit 0 + fi +fi + +# Create BuildKit configuration file with proxy settings +BUILDKIT_CONFIG="" +if [ -n "${HTTP_PROXY:-}" ] || [ -n "${HTTPS_PROXY:-}" ]; then + BUILDKIT_CONFIG="${HOME}/.config/buildkit/buildkitd.toml" + mkdir -p "$(dirname "${BUILDKIT_CONFIG}")" + cat > "${BUILDKIT_CONFIG}" < Date: Tue, 11 Nov 2025 13:29:09 +0000 Subject: [PATCH 4/8] chore: Reverted previous changes --- .../.devcontainer/devcontainer.json | 23 -- .../.devcontainer/setup-proxy.sh | 218 ------------------ 2 files changed, 241 deletions(-) delete mode 100755 src/s-core-devcontainer/.devcontainer/setup-proxy.sh diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer.json b/src/s-core-devcontainer/.devcontainer/devcontainer.json index bf649e4..d53db30 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer.json @@ -48,29 +48,6 @@ "./s-core-local" ], "remoteUser": "vscode", - "runArgs": [ - "--add-host=host.docker.internal:host-gateway", - "--shm-size=16g", - "--cap-add=SYS_PTRACE", - "--cap-add=SYS_NICE", - "--ulimit=rtprio=99", - "--ulimit=nice=-20", - "--security-opt=seccomp=unconfined", - "--env=HTTP_PROXY", - "--env=HTTPS_PROXY", - "--env=http_proxy", - "--env=https_proxy", - "--env=NO_PROXY", - "--env=no_proxy", - "--env=DISPLAY", - "--env=WORKSPACE_FOLDER=/workspace", - "--volume=/var/run/docker.sock:/var/run/docker.sock", - "--volume=..:/workspace:cached", - "--volume=/tmp/.X11-unix:/tmp/.X11-unix", - "--volume=/home/${USER}/.cache/uv:/home/user/.cache/uv" - ], - "workspaceFolder": "/workspace", - "postCreateCommand": "bash .devcontainer/setup-proxy.sh", "customizations": { "vscode": { "extensions": [ diff --git a/src/s-core-devcontainer/.devcontainer/setup-proxy.sh b/src/s-core-devcontainer/.devcontainer/setup-proxy.sh deleted file mode 100755 index 7b44a40..0000000 --- a/src/s-core-devcontainer/.devcontainer/setup-proxy.sh +++ /dev/null @@ -1,218 +0,0 @@ -#!/bin/bash - -# Post-create script to configure Docker daemon with proxy settings -# This script will run automatically when the devcontainer is created - -set -e - -echo "๐Ÿ”ง Setting up Docker daemon with proxy configuration..." - -# Check if any proxy variables are set -if [[ -n "${HTTP_PROXY:-}" || -n "${HTTPS_PROXY:-}" || -n "${http_proxy:-}" || -n "${https_proxy:-}" ]]; then - echo "๐Ÿ“ก Proxy environment detected, configuring Docker daemon..." - - # Create systemd service directory for Docker - sudo mkdir -p /etc/systemd/system/docker.service.d - - # Create Docker daemon proxy configuration - sudo tee /etc/systemd/system/docker.service.d/http-proxy.conf > /dev/null << EOF -[Service] -Environment="HTTP_PROXY=${HTTP_PROXY:-}" -Environment="HTTPS_PROXY=${HTTPS_PROXY:-}" -Environment="http_proxy=${http_proxy:-}" -Environment="https_proxy=${https_proxy:-}" -Environment="NO_PROXY=${NO_PROXY:-localhost,127.0.0.1,docker-registry.example.com,.corp}" -Environment="no_proxy=${no_proxy:-localhost,127.0.0.1,docker-registry.example.com,.corp}" -EOF - - # Create Docker daemon configuration - sudo mkdir -p /etc/docker - sudo tee /etc/docker/daemon.json > /dev/null << EOF -{ - "registry-mirrors": [], - "insecure-registries": [], - "debug": false, - "experimental": false, - "dns": ["8.8.8.8", "1.1.1.1"], - "dns-search": [], - "dns-opts": [] -} -EOF - - # Create Docker client proxy configuration for the user - mkdir -p ~/.docker - tee ~/.docker/config.json > /dev/null << EOF -{ - "proxies": { - "default": { - "httpProxy": "${HTTP_PROXY:-}", - "httpsProxy": "${HTTPS_PROXY:-}", - "noProxy": "${NO_PROXY:-localhost,127.0.0.1}" - } - } -} -EOF - - # Function to restart Docker daemon with proxy settings - restart_docker_with_proxy() { - echo "๐Ÿ”„ Restarting Docker daemon with proxy settings..." - - # Kill existing dockerd if running - if pgrep dockerd > /dev/null; then - echo "Stopping existing Docker daemon..." - sudo pkill dockerd || true - sleep 3 - fi - - # Start Docker daemon with proxy environment variables - echo "Starting Docker daemon with proxy configuration..." - sudo HTTP_PROXY="${HTTP_PROXY:-}" HTTPS_PROXY="${HTTPS_PROXY:-}" \ - http_proxy="${http_proxy:-}" https_proxy="${https_proxy:-}" \ - NO_PROXY="${NO_PROXY:-}" no_proxy="${no_proxy:-}" \ - dockerd --config-file /etc/docker/daemon.json > /dev/null 2>&1 & - - # Wait for Docker to start - echo "Waiting for Docker daemon to start..." - for i in {1..30}; do - if docker info > /dev/null 2>&1; then - echo "โœ… Docker daemon started successfully" - break - fi - echo "Waiting for Docker daemon... ($i/30)" - sleep 2 - done - - # Verify Docker is working - if ! docker info > /dev/null 2>&1; then - echo "โŒ Failed to start Docker daemon, trying alternative approach..." - - # Try without config file - sudo pkill dockerd > /dev/null 2>&1 || true - sleep 2 - sudo HTTP_PROXY="${HTTP_PROXY:-}" HTTPS_PROXY="${HTTPS_PROXY:-}" \ - http_proxy="${http_proxy:-}" https_proxy="${https_proxy:-}" \ - NO_PROXY="${NO_PROXY:-}" no_proxy="${no_proxy:-}" \ - dockerd > /dev/null 2>&1 & - - sleep 5 - if ! docker info > /dev/null 2>&1; then - echo "โŒ Failed to start Docker daemon" - return 1 - fi - fi - - # Verify proxy settings are applied - if docker info | grep -q "HTTP Proxy\|HTTPS Proxy"; then - echo "โœ… Proxy settings successfully applied to Docker daemon" - else - echo "โš ๏ธ Proxy settings may not be fully applied, but Docker is working" - fi - } - - # Restart Docker with proxy settings - restart_docker_with_proxy - - # Configure BuildKit with proxy - echo "๐Ÿ—๏ธ Configuring BuildKit with proxy settings..." - - # Remove existing multiarch builder if it exists - docker buildx rm multiarch 2>/dev/null || true - - # Prepare buildx command with proxy options - BUILDX_CMD="docker buildx create --name multiarch --driver docker-container --driver-opt network=host" - - # Add proxy environment variables only if they are set and non-empty - if [[ -n "${HTTP_PROXY:-}" ]]; then - BUILDX_CMD="$BUILDX_CMD --driver-opt env.HTTP_PROXY=${HTTP_PROXY}" - fi - - if [[ -n "${HTTPS_PROXY:-}" ]]; then - BUILDX_CMD="$BUILDX_CMD --driver-opt env.HTTPS_PROXY=${HTTPS_PROXY}" - fi - - if [[ -n "${http_proxy:-}" ]]; then - BUILDX_CMD="$BUILDX_CMD --driver-opt env.http_proxy=${http_proxy}" - fi - - if [[ -n "${https_proxy:-}" ]]; then - BUILDX_CMD="$BUILDX_CMD --driver-opt env.https_proxy=${https_proxy}" - fi - - # Add NO_PROXY only if set - if [[ -n "${NO_PROXY:-}" ]]; then - BUILDX_CMD="$BUILDX_CMD --driver-opt env.NO_PROXY=${NO_PROXY}" - fi - - if [[ -n "${no_proxy:-}" ]]; then - BUILDX_CMD="$BUILDX_CMD --driver-opt env.no_proxy=${no_proxy}" - fi - - # Execute the buildx command - eval $BUILDX_CMD - - # Use the new builder - docker buildx use multiarch - - # Bootstrap the builder - echo "๐Ÿš€ Bootstrapping BuildKit instance..." - docker buildx inspect --bootstrap - - echo "โœ… Docker and BuildKit configured with proxy settings" - -else - echo "๐ŸŒ No proxy environment detected, using default Docker configuration..." - - # Start Docker daemon if not running - if ! pgrep dockerd > /dev/null; then - echo "๐Ÿ”„ Starting Docker daemon..." - sudo dockerd > /dev/null 2>&1 & - - # Wait for Docker to start - for i in {1..30}; do - if docker info > /dev/null 2>&1; then - echo "โœ… Docker daemon started successfully" - break - fi - echo "Waiting for Docker daemon... ($i/30)" - sleep 2 - done - - if ! docker info > /dev/null 2>&1; then - echo "โŒ Failed to start Docker daemon" - exit 1 - fi - fi - - # Ensure basic Docker configuration exists - sudo mkdir -p /etc/docker - if [[ ! -f /etc/docker/daemon.json ]]; then - sudo tee /etc/docker/daemon.json > /dev/null << EOF -{ - "registry-mirrors": [], - "insecure-registries": [], - "debug": false, - "experimental": false -} -EOF - fi - - # Set up basic BuildKit if not already configured - if ! docker buildx ls | grep -q multiarch; then - echo "๐Ÿ—๏ธ Setting up default BuildKit configuration..." - docker buildx create --name multiarch --driver docker-container --use - docker buildx inspect --bootstrap - fi - - echo "โœ… Default Docker configuration applied" -fi - -# Verify everything is working -echo "๐Ÿงช Testing Docker functionality..." -if docker run --rm hello-world > /dev/null 2>&1; then - echo "โœ… Docker is working correctly" -else - echo "โŒ Docker test failed" - exit 1 -fi - -echo "๐ŸŽ‰ Docker setup completed successfully!" From c81e8edbe6e08a0b5b102398ae515aa761754787 Mon Sep 17 00:00:00 2001 From: "Emrich Oliver (ETAS)" Date: Tue, 11 Nov 2025 16:14:02 +0000 Subject: [PATCH 5/8] feat: Remove empty, proxy-related environment variables if there is a direct internet connection --- src/s-core-devcontainer/.devcontainer/devcontainer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer.json b/src/s-core-devcontainer/.devcontainer/devcontainer.json index d53db30..3162e49 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer.json @@ -48,6 +48,7 @@ "./s-core-local" ], "remoteUser": "vscode", + "postStartCommand": "for var in HTTP_PROXY HTTPS_PROXY http_proxy https_proxy NO_PROXY no_proxy; do [ -z \"${!var}\" ] && unset $var || true; done", "customizations": { "vscode": { "extensions": [ From cbbc584bdf63680b5d08e7452f3e1aca3df42abf Mon Sep 17 00:00:00 2001 From: Oliver Emrich Date: Wed, 12 Nov 2025 14:03:28 +0100 Subject: [PATCH 6/8] fix: Use bash for postStartCommand instead of sh (default) Signed-off-by: Oliver Emrich --- src/s-core-devcontainer/.devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer.json b/src/s-core-devcontainer/.devcontainer/devcontainer.json index 3162e49..4358f8f 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer.json @@ -48,7 +48,7 @@ "./s-core-local" ], "remoteUser": "vscode", - "postStartCommand": "for var in HTTP_PROXY HTTPS_PROXY http_proxy https_proxy NO_PROXY no_proxy; do [ -z \"${!var}\" ] && unset $var || true; done", + "postStartCommand": "bash -c 'for var in HTTP_PROXY HTTPS_PROXY http_proxy https_proxy NO_PROXY no_proxy; do [ -z \"${!var}\" ] && unset $var || true; done'", "customizations": { "vscode": { "extensions": [ From 7e5071010a65436ec61eb251a450369261475b2d Mon Sep 17 00:00:00 2001 From: "Emrich Oliver (ETAS)" Date: Wed, 12 Nov 2025 13:55:13 +0000 Subject: [PATCH 7/8] chore: Add OpenJDK in order to be able to configure Bazel for corporate proxy/CA certificates --- .../.devcontainer/s-core-local/install.sh | 8 ++++++++ .../.devcontainer/s-core-local/versions.yaml | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh index 36ebec1..927d20b 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh @@ -40,6 +40,10 @@ apt-get install -y python${python_version} python3-pip python3-venv # devcontainer feature "python" (cf. https://github.com/devcontainers/features/tree/main/src/python ) apt-get install -y flake8 python3-autopep8 black python3-yapf mypy pydocstyle pycodestyle bandit pipenv virtualenv python3-pytest pylint +# OpenJDK JRE and CA certificates, via APT +# Required for Bazel to work with corporate proxy/CA certificates +apt-get install -y --no-install-recommends ca-certificates-java openjdk-${openjdk_version}-jre-headless + # Bazelisk, directly from GitHub # Using the existing devcontainer feature is not optimal: # - it does not check the SHA256 checksum of the downloaded file @@ -63,6 +67,10 @@ mkdir -p /etc/bash_completion.d mv /tmp/bazel-complete.bash /etc/bash_completion.d/bazel-complete.bash sh -c "echo 'export USE_BAZEL_VERSION=${bazel_version}' >> /etc/profile.d/bazel.sh" +# Configure Bazel to use system trust store for SSL/TLS connections +# This is required for corporate environments with custom CA certificates +echo 'startup --host_jvm_args=-Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts --host_jvm_args=-Djavax.net.ssl.trustStorePassword=changeit' >> /etc/bazel.bazelrc + # Buildifier, directly from GitHub (apparently no APT repository available) # The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file. BUILDIFIER_VARIANT="amd64" diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml index 09205d7..dc5692b 100644 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml @@ -19,6 +19,9 @@ git_lfs: python: version: "3.12" +openjdk: + version: "17" + bazel: # https://github.com/bazelbuild/bazel/releases -- latest version as of 2025-09-24 version: 8.4.1 From 8aae83706ce51796b85894cdd2c6c0bc29901e84 Mon Sep 17 00:00:00 2001 From: "Emrich Oliver (ETAS)" Date: Wed, 12 Nov 2025 15:58:59 +0000 Subject: [PATCH 8/8] feat: Install gdb --- src/s-core-devcontainer/.devcontainer/s-core-local/install.sh | 3 +++ .../.devcontainer/s-core-local/versions.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh index 927d20b..04a702a 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh @@ -113,6 +113,9 @@ apt-get install -y --no-install-recommends --fix-broken qemu-system-arm="${qemu_ # sshpass apt-get install -y sshpass="${sshpass_version}*" +# gdb (GNU Debugger) +apt-get install -y gdb="${gdb_version}*" + # Cleanup # REMOVE CONTAINER BUILD DEPENDENCIES apt-get remove --purge -y apt-transport-https diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml index dc5692b..5c79045 100644 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml @@ -10,6 +10,9 @@ qemu_system_arm: sshpass: version: 1.09 +gdb: + version: "15.0" + git: version: "2.43.0"