|
1 | 1 | # syntax=docker/dockerfile:1 |
2 | 2 | FROM mcr.microsoft.com/devcontainers/base:ubuntu |
3 | 3 |
|
4 | | -# Copy CA certs and Dynamically set NODE_EXTRA_CA_CERTS accordingly |
5 | | -RUN apt-get update && apt-get install -y ca-certificates |
| 4 | +# Copy CA certs and install Ruby and Go via Ubuntu packages (much faster than building from source) |
| 5 | +# Also install development libraries needed for Python compilation via asdf |
| 6 | +RUN apt-get update && apt-get install -y \ |
| 7 | + ca-certificates \ |
| 8 | + ruby-full \ |
| 9 | + ruby-dev \ |
| 10 | + build-essential \ |
| 11 | + golang-go \ |
| 12 | + libsqlite3-dev \ |
| 13 | + libbz2-dev \ |
| 14 | + libncurses-dev \ |
| 15 | + libffi-dev \ |
| 16 | + libreadline-dev \ |
| 17 | + liblzma-dev \ |
| 18 | + libssl-dev \ |
| 19 | + zlib1g-dev \ |
| 20 | + && rm -rf /var/lib/apt/lists/* |
6 | 21 | COPY custom-ca-certs/. /usr/local/share/ca-certificates/ |
7 | 22 | RUN update-ca-certificates |
8 | 23 |
|
9 | | -# Concatenate all certs for use in EnvVars |
10 | | -RUN find /usr/local/share/ca-certificates -type f \( -name '*.pem' -o -name '*.crt' \) -exec cat {} + > "/usr/local/share/ca-certificates/combined-cacerts.pem" |
| 24 | +# Use the updated system CA bundle which now includes both system and custom CAs |
| 25 | +ENV NODE_EXTRA_CA_CERTS="/etc/ssl/certs/ca-certificates.crt" |
| 26 | +ENV SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt" |
| 27 | +ENV REQUESTS_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt" |
| 28 | +ENV CURL_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt" |
| 29 | +ENV GIT_SSL_CAINFO="/etc/ssl/certs/ca-certificates.crt" |
| 30 | + |
| 31 | +# Set Go environment variables and prepend asdf shims/bin to PATH |
| 32 | +ENV GOPATH="/home/vscode/go" |
| 33 | +ENV PATH="/home/vscode/.asdf/shims:/home/vscode/.asdf/bin:/go/bin:${GOPATH}/bin:${PATH}" |
11 | 34 |
|
12 | 35 | # Ensure CA Certs is available for all shells, Node, Python & Ruby |
13 | 36 | USER vscode |
14 | | -RUN echo 'NODE_EXTRA_CA_CERTS="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc |
15 | | -RUN echo 'SSL_CERT_FILE="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc |
16 | | -RUN echo 'REQUESTS_CA_BUNDLE="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc |
17 | | -RUN echo 'CURL_CA_BUNDLE="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc |
18 | | -RUN echo 'GIT_SSL_CAINFO="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc |
| 37 | + |
| 38 | +RUN echo 'NODE_EXTRA_CA_CERTS="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc |
| 39 | +RUN echo 'SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc |
| 40 | +RUN echo 'REQUESTS_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc |
| 41 | +RUN echo 'CURL_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc |
| 42 | +RUN echo 'GIT_SSL_CAINFO="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc |
0 commit comments