Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@
"installDockerComposeSwitch": true,
"moby": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/ruby:1": {}
}
},
"mounts": [
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
Expand Down
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"**/.svn": true,
"**/CVS": true,
"**/Thumbs.db": true,
//".devcontainer": true,
".github": false,
".vscode": false
},
}
}
42 changes: 33 additions & 9 deletions scripts/devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,42 @@
# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/devcontainers/base:ubuntu

# Copy CA certs and Dynamically set NODE_EXTRA_CA_CERTS accordingly
RUN apt-get update && apt-get install -y ca-certificates
# Copy CA certs and install Ruby and Go via Ubuntu packages (much faster than building from source)
# Also install development libraries needed for Python compilation via asdf
RUN apt-get update && apt-get install -y \
ca-certificates \
ruby-full \
ruby-dev \
build-essential \
golang-go \
libsqlite3-dev \
libbz2-dev \
libncurses-dev \
libffi-dev \
libreadline-dev \
liblzma-dev \
libssl-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
COPY custom-ca-certs/. /usr/local/share/ca-certificates/
RUN update-ca-certificates

# Concatenate all certs for use in EnvVars
RUN find /usr/local/share/ca-certificates -type f \( -name '*.pem' -o -name '*.crt' \) -exec cat {} + > "/usr/local/share/ca-certificates/combined-cacerts.pem"
# Use the updated system CA bundle which now includes both system and custom CAs
ENV NODE_EXTRA_CA_CERTS="/etc/ssl/certs/ca-certificates.crt"
ENV SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
ENV REQUESTS_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"
ENV CURL_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"
ENV GIT_SSL_CAINFO="/etc/ssl/certs/ca-certificates.crt"

# Set Go environment variables and prepend asdf shims/bin to PATH
ENV GOPATH="/home/vscode/go"
ENV PATH="/home/vscode/.asdf/shims:/home/vscode/.asdf/bin:/go/bin:${GOPATH}/bin:${PATH}"

# Ensure CA Certs is available for all shells, Node, Python & Ruby
USER vscode
RUN echo 'NODE_EXTRA_CA_CERTS="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc
RUN echo 'SSL_CERT_FILE="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc
RUN echo 'REQUESTS_CA_BUNDLE="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc
RUN echo 'CURL_CA_BUNDLE="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc
RUN echo 'GIT_SSL_CAINFO="/usr/local/share/ca-certificates/combined-cacerts.pem"' >> ~/.zshrc

RUN echo 'NODE_EXTRA_CA_CERTS="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
RUN echo 'SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
RUN echo 'REQUESTS_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
RUN echo 'CURL_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
RUN echo 'GIT_SSL_CAINFO="/etc/ssl/certs/ca-certificates.crt"' >> ~/.zshrc
12 changes: 4 additions & 8 deletions scripts/devcontainer/postcreatecommand.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#!/bin/bash

rm -Rf ~/.asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf;
chmod +x ~/.asdf/asdf.sh;
echo '. $HOME/.asdf/asdf.sh' >> ~/.zshrc
#!/bin/zsh

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

echo 'eval "$(asdf completion zsh)"' >> ~/.zshrc
source ~/.zshrc

echo 'asdf setup complete'

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

sudo gem install jekyll bundler
jekyll --version && cd docs && bundle install

echo 'jekyll setup complete'
Loading