Docker Command

install

Ubuntu

Ubuntu 16.04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common

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"

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Ubuntu 18.04
1
2
3
4
5
# ubuntu 18.04
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# if want to remove it
sudo rm /usr/local/bin/docker-compose

restart

1
2
3
4
docker-compose restart worker

# You can set the time to wait for stop before killing the container (in seconds)
docker-compose restart -t 30 worker

run

pull

Pulls an image associated with a service defined in a docker-compose.yml or docker-stack.yml file