Last active
May 29, 2022 21:06
-
-
Save josegonzalez/732044bfb5c9cc26bb79c6297e81d657 to your computer and use it in GitHub Desktop.
bootstrap a new dev server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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