Skip to content

Instantly share code, notes, and snippets.

@josegonzalez
Last active May 29, 2022
Embed
What would you like to do?
bootstrap a new dev server
#!/usr/bin/env bash
set -eo pipefail
install-docker() {
if command -v /usr/bin/docker >/dev/null 2>&1; then
return
fi
apt update
apt -y install ca-certificates curl gnupg lsb-release
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin
}
main() {
echo "====> Installing Docker"
install-docker
echo "====> Creating codeserver directory"
mkdir -p /var/lib/code-server
chown 1000:1000 /var/lib/code-server
echo "====> Done!"
}
main "$@"
FROM gitpod/openvscode-server:latest
USER root
ARG GO_VERSION=1.18.2.linux-amd64
RUN curl -o /tmp/go.tar.gz -sSL https://go.dev/dl/go1.18.2.linux-amd64.tar.gz && \
tar -C /usr/local -xzf /tmp/go.tar.gz && \
rm -rf /tmp/go.tar.gz
USER openvscode-server
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment