Skip to content

Commit da8fc38

Browse files
committed
chore: Update devcontainer configuration and post-create script for improved SSL certificate handling
1 parent c552ef2 commit da8fc38

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@
7676
"moby": true,
7777
"version": "latest"
7878
},
79+
"ghcr.io/devcontainers/features/go:1": {
80+
"version": "latest"
81+
},
7982
"ghcr.io/devcontainers/features/ruby:1": {}
8083
},
8184
"mounts": [
8285
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
8386
],
8487
"name": "Devcontainer",
85-
"postCreateCommand": "scripts/devcontainer/postcreatecommand.sh"
88+
"postCreateCommand": "zsh scripts/devcontainer/postcreatecommand.sh"
8689
}

scripts/devcontainer/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ RUN update-ca-certificates
99
# Concatenate all certs for use in EnvVars
1010
RUN find /usr/local/share/ca-certificates -type f \( -name '*.pem' -o -name '*.crt' \) -exec cat {} + > "/usr/local/share/ca-certificates/combined-cacerts.pem"
1111

12+
# Set environment variables at the Docker image level so they're available during feature installation
13+
ENV NODE_EXTRA_CA_CERTS="/usr/local/share/ca-certificates/combined-cacerts.pem"
14+
ENV SSL_CERT_FILE="/usr/local/share/ca-certificates/combined-cacerts.pem"
15+
ENV REQUESTS_CA_BUNDLE="/usr/local/share/ca-certificates/combined-cacerts.pem"
16+
ENV CURL_CA_BUNDLE="/usr/local/share/ca-certificates/combined-cacerts.pem"
17+
ENV GIT_SSL_CAINFO="/usr/local/share/ca-certificates/combined-cacerts.pem"
18+
1219
# Ensure CA Certs is available for all shells, Node, Python & Ruby
1320
USER vscode
1421
RUN echo 'NODE_EXTRA_CA_CERTS="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1-
#!/bin/bash
2-
3-
rm -Rf ~/.asdf
4-
git clone https://github.com/asdf-vm/asdf.git ~/.asdf;
5-
chmod +x ~/.asdf/asdf.sh;
6-
echo '. $HOME/.asdf/asdf.sh' >> ~/.zshrc
1+
#!/bin/zsh
72

83
echo 'export GPG_TTY=$TTY' | cat - ~/.zshrc > temp && mv temp ~/.zshrc
94

5+
echo 'export PATH="$HOME/go/bin:/usr/local/go/bin:$PATH"' >> ~/.zshrc
6+
echo 'export PATH="$HOME/.asdf/shims:$PATH"' >> ~/.zshrc
7+
echo 'eval "$(asdf completion zsh)"' >> ~/.zshrc
108
source ~/.zshrc
119

12-
echo 'asdf setup complete'
10+
# Create pip config for SSL certificates before make config runs
11+
mkdir -p ~/.config/pip
12+
cat > ~/.config/pip/pip.conf << EOF
13+
[global]
14+
cert = /usr/local/share/ca-certificates/combined-cacerts.pem
15+
trusted-host = pypi.org
16+
files.pythonhosted.org
17+
pypi.python.org
18+
EOF
1319

1420
make config
1521

22+
gem install jekyll bundler
1623
jekyll --version && cd docs && bundle install
1724

1825
echo 'jekyll setup complete'

0 commit comments

Comments
 (0)