Mudanças entre as edições de "Docker"
De IFRS Campus Canoas
(→Instalação do Docker e Docker Compose no Ubuntu) |
|||
| (10 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
| Linha 1: | Linha 1: | ||
| − | + | ==Instalação do Docker e Docker Compose no Ubuntu== | |
| + | Instalar dependências: | ||
| + | $ sudo apt-get install \ | ||
| + | apt-transport-https \ | ||
| + | ca-certificates \ | ||
| + | curl \ | ||
| + | gnupg2 \ | ||
| + | software-properties-common | ||
| + | Adicionar o repositório: | ||
| + | $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
| + | |||
| + | $ sudo add-apt-repository \ | ||
| + | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | ||
| + | $(lsb_release -cs) \ | ||
| + | stable" | ||
| + | |||
| + | OU adicionar manualmente no arquirvo /etc/apt/source.list | ||
| + | |||
| + | deb [arch=amd64] https://download.docker.com/linux/ubuntu yakkety stable | ||
| + | |||
| + | Update e instalação: | ||
| + | $ sudo apt-get update && sudo apt-get install docker-ce docker-compose -y | ||
| + | |||
| + | == Teste == | ||
| + | $ sudo docker run hello-world | ||
| + | |||
| + | Deve retornar algo como: | ||
| + | Hello from Docker! | ||
| + | This message shows that your installation appears to be working correctly. | ||
| + | ........ | ||
| + | ........ | ||
| + | |||
| + | Em caso de falha, setar o DNS manualmente, seguir a configuração abaixo: | ||
Criar ou editar o arquivo /etc/docker/daemon.json: | Criar ou editar o arquivo /etc/docker/daemon.json: | ||
| Linha 8: | Linha 40: | ||
} | } | ||
| − | sudo service docker restart | + | $ sudo service docker restart |
| + | |||
| + | == Permissões == | ||
| + | $ sudo usermod -aG docker $USER | ||
| + | |||
| + | == Referência== | ||
| + | |||
| + | https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository | ||
Edição atual tal como às 15h35min de 11 de abril de 2018
Instalação do Docker e Docker Compose no Ubuntu
Instalar dependências:
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
Adicionar o repositório:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
OU adicionar manualmente no arquirvo /etc/apt/source.list
deb [arch=amd64] https://download.docker.com/linux/ubuntu yakkety stable
Update e instalação:
$ sudo apt-get update && sudo apt-get install docker-ce docker-compose -y
Teste
$ sudo docker run hello-world
Deve retornar algo como:
Hello from Docker! This message shows that your installation appears to be working correctly. ........ ........
Em caso de falha, setar o DNS manualmente, seguir a configuração abaixo:
Criar ou editar o arquivo /etc/docker/daemon.json:
{
"dns": ["200.17.91.4", "200.17.88.3"]
}
$ sudo service docker restart
Permissões
$ sudo usermod -aG docker $USER
Referência
https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository