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"]} 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}" <> /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" @@ -105,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 09205d7..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" @@ -19,6 +22,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