Last active
January 19, 2022 14:04
-
-
Save askmish/76e348e34d93fc22926d7d9379a0fd08 to your computer and use it in GitHub Desktop.
How to setup docker and docker-compose for sawtooth
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
#update apt | |
sudo apt-get update | |
#install dependencies of docker | |
sudo apt-get install apt-transport-https | |
sudo apt-get install ca-certificates | |
sudo apt-get install curl | |
sudo apt-get install software-properties-common | |
#add docker gpg key to system | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
#add docker to apt repository | |
#sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
#refresh repo | |
sudo apt-get update | |
#install docker | |
sudo apt-get install docker-ce | |
#add current user to docker group | |
sudo usermod -aG docker $USER | |
#Exit your console and relogin | |
#Test docker | |
#if this fails, there's probably a proxy or firewall | |
docker run hello-world | |
#get docker-compose | |
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o ~/docker-compose | |
#install docker-compose to local bin | |
sudo mv docker-compose /usr/local/bin/docker-compose | |
#give executable permission to docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
#test compose installation | |
docker-compose --version |
if
sudo chmod +x /usr/local/bin/docker-compose fails
then use this
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running
sudo usermod -aG docker $USER
gives root-equivalent permission to $USER, which may be OK in a development environment. An alternative is to define aliases fordocker
anddocker-compose
in your~/.bashrc
file (below). You still need to type your password the first time, but at least you don't have to typesudo
all the time: