Skip to content

Commit c38b897

Browse files
committed
build: proxy settings for build and devcontainer
-> devcontainer go version updated to 1.25 -> devcontainer updated to include proxy settings -> build script support proxy build Signed-off-by: Nabendu Maiti <nabendu.bikash.maiti@intel.com>
1 parent 125fbe5 commit c38b897

File tree

2 files changed

+37
-17
lines changed

2 files changed

+37
-17
lines changed

.devcontainer/devcontainer.json

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/go
33
{
4-
"name": "Go",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/go:1-1.23-bullseye",
7-
// Features to add to the dev container. More info: https://containers.dev/features.
8-
// "features": {},
9-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
10-
"forwardPorts": [
11-
8181
12-
],
13-
// Use 'postCreateCommand' to run commands after the container is created.
14-
"postCreateCommand": "go install github.com/cosmtrek/air@latest"
15-
// Configure tool-specific properties.
16-
// "customizations": {},
17-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
18-
// "remoteUser": "root"
19-
}
4+
"name": "Go",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/go:1.25-trixie",
7+
// Features to add to the dev container. More info: https://containers.dev/features.
8+
// "features": {},
9+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
10+
"forwardPorts": [
11+
8181
12+
],
13+
"runArgs": [
14+
"--env",
15+
"HTTP_PROXY=${env:http_proxy:-}",
16+
"--env",
17+
"HTTPS_PROXY=${env:https_proxy:-}",
18+
"--env",
19+
"NO_PROXY=${env:no_proxy:-}",
20+
"--env",
21+
"http_proxy=${env:http_proxy:-}",
22+
"--env",
23+
"https_proxy=${env:https_proxy:-}",
24+
"--env",
25+
"no_proxy=${env:no_proxy:-}"
26+
],
27+
// Use 'postCreateCommand' to run commands after the container is created.
28+
"postCreateCommand": "go install github.com/air-verse/air@latest"
29+
// Configure tool-specific properties.
30+
// "customizations": {},
31+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
32+
// "remoteUser": "root"
33+
}

build.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
# Get version from the first argument
44
version=$1
55

6-
docker build -t vprodemo.azurecr.io/console:v$version .
6+
# Set proxy environment variables if needed
7+
export HTTP_PROXY="${HTTP_PROXY:-${http_proxy:-}}"
8+
export HTTPS_PROXY="${HTTPS_PROXY:-${https_proxy:-}}"
9+
export NO_PROXY="${NO_PROXY:-${no_proxy:-localhost,127.0.0.1}}"
10+
11+
12+
docker build --build-arg HTTP_PROXY=$HTTP_PROXY --build-arg HTTPS_PROXY=$HTTPS_PROXY --build-arg NO_PROXY=$NO_PROXY -t vprodemo.azurecr.io/console:v$version .
713

814
# Mark the Unix system outputs as executable
915
chmod +x dist/linux/console_linux_x64

0 commit comments

Comments
 (0)