Last active
March 31, 2021 14:51
-
-
Save EonYang/8e9319699ad8177ff44460684c5ac758 to your computer and use it in GitHub Desktop.
Setup docker on a new Raspberry Pi
This file contains 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
# install ubuntu server on the pi and ssh into the server | |
# https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview | |
# create new user with shorter name | |
sudo adduser pi | |
sudo usermod -aG sudo pi | |
# copying SSH key | |
# on your Mac | |
ssh-copy-id -i ~/.ssh/id_rsa pi@pi3 | |
# install docker | |
sudo snap install docker | |
# grant permission to current user | |
sudo groupadd docker | |
sudo usermod -aG docker $USER | |
newgrp docker | |
# test docker | |
docker run --rm hello-world | |
# if permission error, reboot and try again | |
sudo reboot | |
# docker compose should be ready too | |
docker-compose version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment