Skip to content

Instantly share code, notes, and snippets.

@senisioi
Last active February 16, 2022 06:28
Show Gist options
  • Save senisioi/0d4326775cade99ce2dec41b8d716b04 to your computer and use it in GitHub Desktop.
Save senisioi/0d4326775cade99ce2dec41b8d716b04 to your computer and use it in GitHub Desktop.
if getent passwd student > /dev/null 2>&1; then
echo "User student exists"
else
sudo adduser --disabled-password --gecos "" student
fi
sudo apt-get update && \
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
gnupg \
lsb-release && \
#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
#sudo apt-key fingerprint 0EBFCD88 && \
#sudo add-apt-repository \
# "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
# $(lsb_release -cs) \
# stable" && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
sudo apt-get update && \
sudo apt-get install -y docker-ce docker-ce-cli containerd.io && \
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose && \
sudo usermod -aG docker $USER && \
sudo usermod -aG docker student && \
sudo passwd -d student && \
newgrp docker && \
echo "DONE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment