Skip to content

Commit 4cfbf54

Browse files
committed
chore: Enhance devcontainer setup with improved Zsh configuration and additional dependencies
1 parent 29b9b48 commit 4cfbf54

File tree

3 files changed

+35
-17
lines changed

3 files changed

+35
-17
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@
7575
"installDockerComposeSwitch": true,
7676
"moby": true,
7777
"version": "latest"
78-
},
79-
"ghcr.io/devcontainers/features/go:1": {
80-
"version": "latest"
81-
},
82-
"ghcr.io/devcontainers/features/ruby:1": {}
78+
}
8379
},
8480
"mounts": [
8581
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"

scripts/devcontainer/Dockerfile

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
# syntax=docker/dockerfile:1
22
FROM mcr.microsoft.com/devcontainers/base:ubuntu
33

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/*
621
COPY custom-ca-certs/. /usr/local/share/ca-certificates/
722
RUN update-ca-certificates
823

@@ -13,10 +28,19 @@ ENV REQUESTS_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"
1328
ENV CURL_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"
1429
ENV GIT_SSL_CAINFO="/etc/ssl/certs/ca-certificates.crt"
1530

31+
# Set Go environment variables
32+
ENV GOPATH="/home/vscode/go"
33+
ENV PATH="/go/bin:${GOPATH}/bin:${PATH}"
34+
1635
# Ensure CA Certs is available for all shells, Node, Python & Ruby
1736
USER vscode
37+
1838
RUN echo 'NODE_EXTRA_CA_CERTS="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
1939
RUN echo 'SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
2040
RUN echo 'REQUESTS_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
2141
RUN echo 'CURL_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
2242
RUN echo 'GIT_SSL_CAINFO="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
43+
44+
# Add Go environment to shell
45+
RUN echo 'export GOPATH="/home/vscode/go"' >> ~/.zshrc
46+
RUN echo 'export PATH="/go/bin:$GOPATH/bin:$PATH"' >> ~/.zshrc

scripts/devcontainer/postcreatecommand.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,19 @@ echo 'export GPG_TTY=$TTY' | cat - ~/.zshrc > temp && mv temp ~/.zshrc
55
echo 'export PATH="$HOME/go/bin:/usr/local/go/bin:$PATH"' >> ~/.zshrc
66
echo 'export PATH="$HOME/.asdf/shims:$PATH"' >> ~/.zshrc
77
echo 'eval "$(asdf completion zsh)"' >> ~/.zshrc
8-
echo 'export SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
9-
echo 'export REQUESTS_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
10-
echo 'export CURL_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
118
source ~/.zshrc
129

13-
# Create pip config for SSL certificates before make config runs
14-
mkdir -p ~/.config/pip
15-
cat > ~/.config/pip/pip.conf << EOF
16-
[global]
17-
cert = /etc/ssl/certs/ca-certificates.crt
18-
EOF
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 = /etc/ssl/certs/ca-certificates.crt
15+
# EOF
1916

17+
make _install-dependencies # required before config to ensure python is available due to race between config:: make targets
2018
make config
2119

22-
gem install jekyll bundler
20+
sudo gem install jekyll bundler
2321
jekyll --version && cd docs && bundle install
2422

2523
echo 'jekyll setup complete'

0 commit comments

Comments
 (0)