Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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 | sudo apt-key add -
#add docker to apt repository
#sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
sudo add-apt-repository \
"deb [arch=amd64] \
$(lsb_release -cs) \
#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`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

This comment has been minimized.

Copy link

@danintel danintel commented May 30, 2018

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment