File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616set -euxo pipefail
1717
18+ SCRIPT_PATH=$( readlink -f " $0 " )
19+ SCRIPT_DIR=$( dirname -- " ${SCRIPT_PATH} " )
20+
1821if [[ " $# " -lt 1 || " ${1} " != " --arm64" && " ${1} " != " --amd64" ]]; then
1922 echo " Error: First parameter must be --arm64 or --amd64."
2023 exit 1
@@ -46,6 +49,9 @@ for LABEL in "${LABELS[@]}"; do
4649 IMAGES+=(" --image-name \" ghcr.io/eclipse-score/devcontainer:${LABEL} -${ARCH} \" " )
4750done
4851
52+ . " ${SCRIPT_DIR} /functions.sh"
53+ set_dockerfile_name
54+
4955# Prepare devcontainer build command
5056DEVCONTAINER_CALL=" devcontainer build --workspace-folder src/s-core-devcontainer --cache-from ghcr.io/eclipse-score/devcontainer"
5157
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # *******************************************************************************
4+ # Copyright (c) 2026 Contributors to the Eclipse Foundation
5+ #
6+ # See the NOTICE file(s) distributed with this work for additional
7+ # information regarding copyright ownership.
8+ #
9+ # This program and the accompanying materials are made available under the
10+ # terms of the Apache License Version 2.0 which is available at
11+ # https://www.apache.org/licenses/LICENSE-2.0
12+ #
13+ # SPDX-License-Identifier: Apache-2.0
14+ # *******************************************************************************
15+
16+ set_dockerfile_name () {
17+ DEVCONTAINER_DOCKERFILE_NAME=" Dockerfile"
18+
19+ # Check if proxies are configured in the environment
20+ set +u
21+ if [ -n " ${HTTP_PROXY}${HTTPS_PROXY}${http_proxy}${https_proxy}${NO_PROXY}${no_proxy} " ]; then
22+ DEVCONTAINER_DOCKERFILE_NAME=" Dockerfile-with-proxy-vars"
23+ echo " Proxy environment detected."
24+ fi
25+ set -u
26+
27+ export DEVCONTAINER_DOCKERFILE_NAME
28+ echo " Using Dockerfile: ${DEVCONTAINER_DOCKERFILE_NAME} "
29+ }
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ SCRIPT_DIR=$(dirname -- "${SCRIPT_PATH}")
2424PROJECT_DIR=$( dirname -- " ${SCRIPT_DIR} " )
2525ID_LABEL=" test-container=${IMAGE} "
2626
27+ . " ${SCRIPT_DIR} /functions.sh"
28+ set_dockerfile_name
29+
2730devcontainer up \
2831 --id-label " ${ID_LABEL} " \
2932 --workspace-folder " ${PROJECT_DIR} /src/${IMAGE} /" \
Original file line number Diff line number Diff line change 11FROM buildpack-deps:noble-curl
22
3- # Proxy arguments for build-time network access
4- ARG HTTP_PROXY=""
5- ARG HTTPS_PROXY=""
6- ARG http_proxy=""
7- ARG https_proxy=""
8- ARG NO_PROXY=""
9- ARG no_proxy=""
10-
11- # Set proxy environment variables for the build process
12- ENV HTTP_PROXY=${HTTP_PROXY}
13- ENV HTTPS_PROXY=${HTTPS_PROXY}
14- ENV http_proxy=${http_proxy}
15- ENV https_proxy=${https_proxy}
16- ENV NO_PROXY=${NO_PROXY}
17- ENV no_proxy=${no_proxy}
18-
193LABEL dev.containers.features="common"
204
21- # Unset proxy variables for all login shells
22- COPY unset-proxy.sh /etc/profile.d/unset-proxy.sh
23-
245RUN userdel -f -r ubuntu
Original file line number Diff line number Diff line change 1+ FROM buildpack-deps:noble-curl
2+
3+ # Proxy arguments for build-time network access
4+ ARG HTTP_PROXY=""
5+ ARG HTTPS_PROXY=""
6+ ARG http_proxy=""
7+ ARG https_proxy=""
8+ ARG NO_PROXY=""
9+ ARG no_proxy=""
10+
11+ # Set proxy environment variables for the build process
12+ ENV HTTP_PROXY=${HTTP_PROXY}
13+ ENV HTTPS_PROXY=${HTTPS_PROXY}
14+ ENV http_proxy=${http_proxy}
15+ ENV https_proxy=${https_proxy}
16+ ENV NO_PROXY=${NO_PROXY}
17+ ENV no_proxy=${no_proxy}
18+
19+ LABEL dev.containers.features="common"
20+
21+ # Unset proxy variables for all login shells
22+ COPY unset-proxy.sh /etc/bash_completion.d/unset-proxy.sh
23+
24+ RUN userdel -f -r ubuntu
Original file line number Diff line number Diff line change 11{
22 "build" : {
33 // Installs latest version from the Distribution
4- "dockerfile" : " ./Dockerfile" ,
4+ "dockerfile" : " ./${localEnv:DEVCONTAINER_DOCKERFILE_NAME: Dockerfile} " ,
55 "context" : " ." ,
66 "args" : {
77 "HTTP_PROXY" : " ${localEnv:HTTP_PROXY}" ,
Original file line number Diff line number Diff line change 1313# SPDX-License-Identifier: Apache-2.0
1414# *******************************************************************************
1515
16- # /etc/profile .d/unset-proxy.sh
16+ # /etc/bash_completion .d/unset-proxy.sh
1717# Unset proxy variables for all login shells if they are empty
1818for var in HTTP_PROXY HTTPS_PROXY http_proxy https_proxy NO_PROXY no_proxy; do
1919 if [ -z " ${! var} " ]; then
Original file line number Diff line number Diff line change 1515
1616set -euo pipefail
1717
18- source " test-utils.sh" vscode
18+ SCRIPT_PATH=$( readlink -f " $0 " )
19+ SCRIPT_DIR=$( dirname -- " ${SCRIPT_PATH} " )
20+
21+ source " ${SCRIPT_DIR} /test-utils.sh" vscode
1922
2023# C++ tooling
2124check " validate clangd is working and has the correct version" bash -c " clangd --version | grep '20.1.8'"
@@ -36,5 +39,14 @@ source /devcontainer/features/s-core-local/tests/test_default.sh
3639# Tests from the local bazel feature
3740source /devcontainer/features/bazel/tests/test_default.sh
3841
42+ # Check that no environment variables are empty
43+ . /etc/bash_completion
44+ for var in $( compgen -e) ; do
45+ if [[ " ${var} " == " LS_COLORS" ]]; then
46+ continue
47+ fi
48+ check " validate environment variable ${var} is not empty" bash -c " [ -n \"\$ {${var} }\" ]"
49+ done
50+
3951# Report result
4052reportResults
You can’t perform that action at this time.
0 commit comments