microsoft / microsoft/vscode-remote-release

Env Vars (proxy) specified in devcontainer.json don't propagate to containers used to build/add advanced features

Open
#6,464 28 comments 18 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Mar 17, 2022.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

When trying to add the "docker-in-docker" and/or the "docker-from-docker" feature to my dev container, it attempts to download using the apt-get package manager. I have specified the required PROXY env variables in my JSON file, however those settings do not propogate to the docker build for that step. Is there a work around?

  • Version: 1.64.2 (system setup)
  • Commit: f80445acd5a3dadef24aa209168452a3d97cc326
  • Date: 2022-02-09T22:02:28.252Z
  • Electron: 13.5.2
  • Chromium: 91.0.4472.164
  • Node.js: 14.16.0
  • V8: 9.1.269.39-electron.0
  • OS: Windows_NT x64 10.0.19042
  • Local chip architecture: x86
  • Reproduces in: Remote - Containers
  • Name of Dev Container Definition with Issue:

Steps to Reproduce:

  1. Set proxy env vars in devcontainer.json
  "containerEnv": {
    "HTTP_PROXY": "${localEnv:HTTP_PROXY}",
    "HTTPS_PROXY": "${localEnv:HTTP_PROXY}",
    "http_proxy": "${localEnv:HTTP_PROXY}",
    "https_proxy": "${localEnv:HTTP_PROXY}"
  },
  1. Add "docker-from-docker" feature
  "features": {
    "docker-from-docker": "20.10"
  }
  1. Fails to use proxy when trying to install that feature using apt-get

See Logs for connect timeout cause proxy is required in my env:

[2022-02-21T23:41:48.209Z] Start: Resolving Remote
[2022-02-21T23:41:48.218Z] Start: Run: ssh 632 /bin/sh -c /bin/sh
[2022-02-21T23:41:48.251Z] Start: Run in host: id -un
[2022-02-21T23:41:50.037Z] devuser
[2022-02-21T23:41:50.037Z] Authorized uses only.  All activity may be monitored and reported.
[2022-02-21T23:41:50.037Z] Stop (1786 ms): Run in host: id -un
[2022-02-21T23:41:50.037Z] Start: Run in host: cat /etc/passwd
[2022-02-21T23:41:50.086Z] Stop (49 ms): Run in host: cat /etc/passwd
[2022-02-21T23:41:50.086Z] Start: Run in host: echo ~
[2022-02-21T23:41:50.123Z] /home/devuser
[2022-02-21T23:41:50.124Z] 
[2022-02-21T23:41:50.124Z] Stop (38 ms): Run in host: echo ~
[2022-02-21T23:41:50.124Z] Start: Run in host: test -x '/home/devuser/.vscode-remote-containers/bin/f80445acd5a3dadef24aa209168452a3d97cc326/node'
[2022-02-21T23:41:50.160Z] 
[2022-02-21T23:41:50.160Z] 
[2022-02-21T23:41:50.160Z] Exit code 1
[2022-02-21T23:41:50.160Z] Stop (36 ms): Run in host: test -x '/home/devuser/.vscode-remote-containers/bin/f80445acd5a3dadef24aa209168452a3d97cc326/node'
[2022-02-21T23:41:50.161Z] Start: Run in host: test -x '/home/devuser/.vscode-server/bin/f80445acd5a3dadef24aa209168452a3d97cc326/node'
[2022-02-21T23:41:50.198Z] 
[2022-02-21T23:41:50.199Z] 
[2022-02-21T23:41:50.199Z] Stop (38 ms): Run in host: test -x '/home/devuser/.vscode-server/bin/f80445acd5a3dadef24aa209168452a3d97cc326/node'
[2022-02-21T23:41:50.199Z] Start: Run in host: test -f '/home/devuser/.vscode-server/bin/f80445acd5a3dadef24aa209168452a3d97cc326/node_modules/node-pty/package.json'
[2022-02-21T23:41:50.235Z] 
[2022-02-21T23:41:50.235Z] 
[2022-02-21T23:41:50.236Z] Stop (37 ms): Run in host: test -f '/home/devuser/.vscode-server/bin/f80445acd5a3dadef24aa209168452a3d97cc326/node_modules/node-pty/package.json'
[2022-02-21T23:41:50.236Z] Start: Run in host: test -f '/home/devuser/.vscode-remote-containers/dist/vscode-remote-containers-server-0.217.4.js'
[2022-02-21T23:41:50.272Z] 
[2022-02-21T23:41:50.273Z] 
[2022-02-21T23:41:50.273Z] Stop (37 ms): Run in host: test -f '/home/devuser/.vscode-remote-containers/dist/vscode-remote-containers-server-0.217.4.js'
[2022-02-21T23:41:50.314Z] userEnvProbe: loginInteractiveShell (default)
[2022-02-21T23:41:50.315Z] userEnvProbe shell: /bin/bash
[2022-02-21T23:41:51.533Z] userEnvProbe PATHs:
Probe:     '/app/jdk/jdk-11/bin:/app/jdk/jdk-11.0.7+10/bin:/usr/lib64/qt-3.3/bin:/app/devtools/maven/apache-maven-3.6.2/bin:/app/devtools/gradle/gradle-5.6.3/bin:/home/devuser/.nvm/versions/node/v12.18.3/bin:/usr/local/bin:/usr/bin:/home/devuser/.krew/bin:/usr/local/sbin:/usr/sbin:/opt/rh/rh-nodejs8/root/bin:/var/lib/snapd/snap/bin:/home/devuser/.local/bin:/home/devuser/bin:/home/devuser/.krew/bin:/home/devuser/.local/bin:/home/devuser/bin'
Container: None
[2022-02-21T23:41:51.572Z] Setting up container for folder or workspace: /app/git/ibadmin
[2022-02-21T23:41:51.572Z] Host: ssh://632
[2022-02-21T23:41:51.576Z] Start: Check Docker is running
[2022-02-21T23:41:51.576Z] Start: Run in Host: docker version --format {{.Server.APIVersion}}
[2022-02-21T23:41:51.690Z] Stop (114 ms): Run in Host: docker version --format {{.Server.APIVersion}}
[2022-02-21T23:41:51.690Z] Server API version: 1.41
[2022-02-21T23:41:51.691Z] Stop (115 ms): Check Docker is running
[2022-02-21T23:41:51.943Z] Start: Run in Host: git rev-parse --show-cdup
[2022-02-21T23:41:52.019Z] Stop (76 ms): Run in Host: git rev-parse --show-cdup
[2022-02-21T23:41:52.022Z] Start: Run in Host: docker ps -q -a --filter label=vsch.local.folder=/app/git/ibadmin --filter label=vsch.quality=stable
[2022-02-21T23:41:52.112Z] Stop (90 ms): Run in Host: docker ps -q -a --filter label=vsch.local.folder=/app/git/ibadmin --filter label=vsch.quality=stable
[2022-02-21T23:41:52.113Z] Start: Run in Host: docker build -f /app/git/ibadmin/.devcontainer/Dockerfile -t vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298 --build-arg VARIANT=buster --build-arg INSTALL_MAVEN=true --build-arg INSTALL_GRADLE=false --build-arg NODE_VERSION=lts/* --build-arg HTTP_PROXY=http://172.18.69.27:3128 --build-arg HTTPS_PROXY=http://172.18.69.27:3128 /app/git/ibadmin/.devcontainer
[2022-02-21T23:41:52.214Z] Sending build context to Docker daemon  5.632kB


[2022-02-21T23:41:52.328Z] Step 1/11 : ARG VARIANT="buster"
Step 2/11 : FROM mcr.microsoft.com/vscode/devcontainers/java:0-8-${VARIANT}
 ---> 08cfa3490570
Step 3/11 : ENV HTTP_PROXY="http://172.18.69.27:3128"
[2022-02-21T23:41:52.328Z]  ---> Using cache
 ---> 50052f2b5c63
Step 4/11 : ENV HTTPS_PROXY="http://172.18.69.27:3128"
[2022-02-21T23:41:52.328Z]  ---> Using cache
 ---> c7c80e00e77b
Step 5/11 : ARG INSTALL_MAVEN="true"
[2022-02-21T23:41:52.328Z]  ---> Using cache
 ---> e56400deb83e
Step 6/11 : ARG MAVEN_VERSION=""
[2022-02-21T23:41:52.329Z]  ---> Using cache
 ---> a055242192b5
Step 7/11 : ARG INSTALL_GRADLE="false"
[2022-02-21T23:41:52.329Z]  ---> Using cache
 ---> 147dead85f91
Step 8/11 : ARG GRADLE_VERSION=""
[2022-02-21T23:41:52.329Z]  ---> Using cache
 ---> 2bc3e0779d9e
Step 9/11 : RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi     && if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi
[2022-02-21T23:41:52.329Z]  ---> Using cache
 ---> c5179dc28bf9
Step 10/11 : ARG NODE_VERSION="lts/*"
[2022-02-21T23:41:52.330Z]  ---> Using cache
 ---> 3c7ebe86176d
Step 11/11 : RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
[2022-02-21T23:41:52.330Z]  ---> Using cache
 ---> 50b6c0a3eb9e
[2022-02-21T23:41:52.331Z] Successfully built 50b6c0a3eb9e
[2022-02-21T23:41:52.338Z] Successfully tagged vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298:latest
[2022-02-21T23:41:52.339Z] Stop (226 ms): Run in Host: docker build -f /app/git/ibadmin/.devcontainer/Dockerfile -t vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298 --build-arg VARIANT=buster --build-arg INSTALL_MAVEN=true --build-arg INSTALL_GRADLE=false --build-arg NODE_VERSION=lts/* --build-arg HTTP_PROXY=http://172.18.69.27:3128 --build-arg HTTPS_PROXY=http://172.18.69.27:3128 /app/git/ibadmin/.devcontainer
[2022-02-21T23:41:52.434Z] Preparing to parse declared features and fetch remote features.
[2022-02-21T23:41:52.435Z] Detected local feature set. Continuing...
[2022-02-21T23:41:52.435Z] Start: Run in Host: docker inspect --type image vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298
[2022-02-21T23:41:52.528Z] Stop (93 ms): Run in Host: docker inspect --type image vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298
[2022-02-21T23:41:52.534Z] local container features stored at: c:\Users\z076075\.vscode\extensions\ms-vscode-remote.remote-containers-0.217.4\dist\node_modules\vscode-dev-containers\container-features
[2022-02-21T23:41:52.614Z] Start: Run in Host: tar --no-same-owner -x -f -
[2022-02-21T23:41:52.825Z] Stop (211 ms): Run in Host: tar --no-same-owner -x -f -
[2022-02-21T23:41:52.911Z] Start: Run in Host: docker build -t vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298-features --build-arg BASE_IMAGE=vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298 --build-arg IMAGE_USER=root /tmp/vsch/container-features/0.217.4-1645486912339
[2022-02-21T23:41:53.086Z] Sending build context to Docker daemon  274.9kB


[2022-02-21T23:41:53.100Z] Step 1/10 : ARG BASE_IMAGE=mcr.microsoft.com/vscode/devcontainers/base:buster
Step 2/10 : FROM $BASE_IMAGE
[2022-02-21T23:41:53.100Z]  ---> 50b6c0a3eb9e
Step 3/10 : USER root
[2022-02-21T23:41:53.101Z]  ---> Using cache
 ---> 6a7ca345465e
Step 4/10 : COPY . /tmp/build-features/
[2022-02-21T23:41:53.108Z]  ---> Using cache
 ---> e1892b8df676
Step 5/10 : RUN cd /tmp/build-features/local-cache && chmod +x ./install.sh && ./install.sh
[2022-02-21T23:41:53.220Z]  ---> Running in f2a57bdf445d
[2022-02-21T23:41:53.634Z] (*) Script: docker-debian.sh true /var/run/docker-host.sock /var/run/docker.sock automatic true 20.10
[2022-02-21T23:41:54.092Z] MICROSOFT_GPG_KEYS_URI=https://packages.microsoft.com/keys/microsoft.asc
[2022-02-21T23:42:24.844Z] Err:1 https://packages.microsoft.com/repos/microsoft-debian-buster-prod buster InRelease
  Could not connect to packages.microsoft.com:443 (13.84.47.71), connection timed out
[2022-02-21T23:42:25.062Z] Err:2 https://dl.yarnpkg.com/debian stable InRelease
  Could not connect to dl.yarnpkg.com:443 (104.18.126.100), connection timed out Could not connect to dl.yarnpkg.com:443 (104.16.171.99), connection timed out
[2022-02-21T23:42:55.342Z] Err:3 http://deb.debian.org/debian buster InRelease
  Could not connect to debian.map.fastlydns.net:80 (199.232.94.132), connection timed out Could not connect to deb.debian.org:80 (146.75.94.132), connection timed out
Err:4 http://deb.debian.org/debian buster-updates InRelease
  Unable to connect to deb.debian.org:http:
[2022-02-21T23:42:56.279Z] Err:5 http://security.debian.org/debian-security buster/updates InRelease
  Could not connect to debian.map.fastlydns.net:80 (199.232.94.132), connection timed out Could not connect to security.debian.org:80 (151.101.2.132), connection timed out Could not connect to security.debian.org:80 (151.101.130.132), connection timed out Could not connect to security.debian.org:80 (151.101.194.132), connection timed out Could not connect to security.debian.org:80 (151.101.66.132), connection timed out
[2022-02-21T23:42:56.287Z] Reading package lists...
[2022-02-21T23:42:56.299Z] 
[2022-02-21T23:42:56.299Z] W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Could not connect to debian.map.fastlydns.net:80 (199.232.94.132), connection timed out Could not connect to deb.debian.org:80 (146.75.94.132), connection timed out
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Could not connect to debian.map.fastlydns.net:80 (199.232.94.132), connection timed out Could not connect to security.debian.org:80 (151.101.2.132), connection timed out Could not connect to security.debian.org:80 (151.101.130.132), connection timed out Could not connect to security.debian.org:80 (151.101.194.132), connection timed out Could not connect to security.debian.org:80 (151.101.66.132), connection timed out
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Unable to connect to deb.debian.org:http:
W: Failed to fetch https://packages.microsoft.com/repos/microsoft-debian-buster-prod/dists/buster/InRelease  Could not connect to packages.microsoft.com:443 (13.84.47.71), connection timed out
W: Failed to fetch https://dl.yarnpkg.com/debian/dists/stable/InRelease  Could not connect to dl.yarnpkg.com:443 (104.18.126.100), connection timed out Could not connect to dl.yarnpkg.com:443 (104.16.171.99), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
[2022-02-21T23:42:56.339Z] (!) No full or partial Docker / Moby version match found for "20.10" on OS debian buster (amd64). Available versions:
[2022-02-21T23:42:56.521Z] The command '/bin/sh -c cd /tmp/build-features/local-cache && chmod +x ./install.sh && ./install.sh' returned a non-zero code: 1
[2022-02-21T23:42:56.521Z] Stop (63610 ms): Run in Host: docker build -t vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298-features --build-arg BASE_IMAGE=vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298 --build-arg IMAGE_USER=root /tmp/vsch/container-features/0.217.4-1645486912339
[2022-02-21T23:42:56.524Z] Command failed: docker build -t vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298-features --build-arg BASE_IMAGE=vsc-ibadmin-4e2cf3cef36046cf2c7fcdda42c7c298 --build-arg IMAGE_USER=root /tmp/vsch/container-features/0.217.4-1645486912339
[2022-02-21T23:42:56.524Z] Exit code 1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.