Docker: различия между версиями

Материал из Home Wiki
Перейти к навигации Перейти к поиску
Строка 5: Строка 5:


Add the docker group if it doesn't already exist:
Add the docker group if it doesn't already exist:
 
<syntaxhighlight lang="bash">
sudo groupadd docker
sudo groupadd docker
</syntaxhighlight>


Add the connected user "${USER}" to the docker group. Change the user name to match your preferred user:
Add the connected user "${USER}" to the docker group. Change the user name to match your preferred user:
 
<syntaxhighlight lang="bash">
sudo gpasswd -a ${USER} docker
sudo gpasswd -a ${USER} docker
</syntaxhighlight>


Restart the Docker daemon:
Restart the Docker daemon:
 
<syntaxhighlight lang="bash">
sudo service docker restart
sudo service docker restart
</syntaxhighlight>


If you are on Ubuntu 14.04-15.10* use docker.io instead:
If you are on Ubuntu 14.04-15.10* use docker.io instead:
 
<syntaxhighlight lang="bash">
sudo service docker.io restart
sudo service docker.io restart
</syntaxhighlight>


= Удаление не нужных образов =
= Удаление не нужных образов =

Версия 03:03, 30 мая 2017

Категория:Работа

Настройка для пользователя

http://askubuntu.com/questions/477551/how-can-i-use-docker-without-sudo/477554#477554

Add the docker group if it doesn't already exist:

sudo groupadd docker

Add the connected user "${USER}" to the docker group. Change the user name to match your preferred user:

sudo gpasswd -a ${USER} docker

Restart the Docker daemon:

sudo service docker restart

If you are on Ubuntu 14.04-15.10* use docker.io instead:

sudo service docker.io restart

Удаление не нужных образов

docker rmi $(docker images | grep "<none>" | awk "{print \$3}")