Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom CA certificates #7341

Closed
MarkKharitonov opened this issue Oct 7, 2022 · 1 comment
Closed

Add support for custom CA certificates #7341

MarkKharitonov opened this issue Oct 7, 2022 · 1 comment
Labels
containers Issue in vscode-remote containers

Comments

@MarkKharitonov
Copy link

I followed the instructions in https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers, but the dev-containers failed to run to completion. The root cause is this command in the generated Dockerfile:

nvm install ${NODE_VERSION}

(when NODE_VERSION is not "none")
The nvm install was unable to find any versions, because our corporate network requires two custom CA certificates (ZScaler and DigiCert). The only way I could make it work is by following these steps:

  1. Copy the custom certificates file (let us name it xyz.crt) to the helloworld-django directory.
  2. Modify the auto generated Dockerfile:
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

COPY xyz.crt /xyz.crt         # !!! THIS IS THE FIRST CHANGE 

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
# !!! THIS IS THE SECOND CHANGE - notice CURL_CA_BUNDLE=/xyz.crt before calling nvm install
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && CURL_CA_BUNDLE=/xyz.crt nvm install ${NODE_VERSION} 2>&1"; fi

I propose to add a question asking for the path of the optional custom certificates file, so that if given it would modify the generated Dockerfile accordingly.

Relates to: <Codespaces | Remote - Containers | Both>

@Chuxel Chuxel transferred this issue from microsoft/vscode-dev-containers Oct 12, 2022
@Chuxel Chuxel added the containers Issue in vscode-remote containers label Oct 12, 2022
@chrmarti
Copy link
Contributor

Continuing in #6092. Thanks.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers
Projects
None yet
Development

No branches or pull requests

3 participants