Skip to content

Instantly share code, notes, and snippets.

@askmish
Last active January 19, 2022 14:04
Show Gist options
  • Save askmish/76e348e34d93fc22926d7d9379a0fd08 to your computer and use it in GitHub Desktop.
Save askmish/76e348e34d93fc22926d7d9379a0fd08 to your computer and use it in GitHub Desktop.
How to setup docker and docker-compose for sawtooth
#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
@danintel
Copy link

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 for docker and docker-compose in your ~/.bashrc file (below). You still need to type your password the first time, but at least you don't have to type sudo all the time:

alias docker='sudo docker'
alias docker-compose='sudo docker-compose'

@tunna-7
Copy link

tunna-7 commented Jan 19, 2022

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