官术网_书友最值得收藏!

Post-install steps you might want to consider

All three of these install methods automatically create a docker group for you, but if you want to be able to run Docker commands without using root or sudo, you will want to add your user to the docker group.

Be aware that many Docker commands require full admin access to execute, so adding a user to the docker group is comparable to granting them root access, and the security implications should be considered. If the user already has root access on their workstation, adding them to the docker group is only providing them a convenience.

Adding the current user to the docker group is easily accomplished with the following command:

# add the current user to the docker group
sudo usermod -aG docker $USER

You will need to log out and log back in to update the group memberships on your account, but once you have done that, you should be all set to execute any Docker commands without using sudo. 

This can be validated with the hello-world container:

# validate that sudo is no longer needed
docker run hello-world

Another post-install step you should consider is installing docker-compose. 

This tool can be an important addition to your Docker tool belt and we will be discussing its use in Chapter 7, Docker StacksThe command to install docker-compose is: 

# install docker-compose
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

Congratulations, your Ubuntu workstation is now ready to start developing your Docker images and deploying your Docker containers. Next up, we will learn how to install Docker onto a Windows-based workstation. If you're ready, read on.

主站蜘蛛池模板: 垦利县| 文安县| 锦屏县| 延安市| 凭祥市| 依兰县| 龙州县| 丹阳市| 西乡县| 化州市| 廊坊市| 瑞金市| 安庆市| 额尔古纳市| 新巴尔虎左旗| 南安市| 梓潼县| 大化| 胶州市| 麻江县| 阿图什市| 工布江达县| 浦城县| 上栗县| 五华县| 宁乡县| 商丘市| 达州市| 青海省| 湘西| 浑源县| 彰化县| 万盛区| 新野县| 清河县| 拜泉县| 项城市| 石楼县| 五台县| 陆丰市| 林西县|