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

Post-install steps you might want to consider

All three of the 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, then 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 by running the hello-world container without sudo:

# test that sudo is not needed
docker run hello-world

Next, you will want to configure your system to have the Docker service start on system-boot:

# configure docker to start on boot
sudo systemctl enable docker

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 Stacks. The 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 CentOS 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 DEB-based system using an Ubuntu workstation. If you're ready, read on.

主站蜘蛛池模板: 芷江| 通河县| 神农架林区| 称多县| 澄城县| 土默特右旗| 宜州市| 年辖:市辖区| 黔西县| 常德市| 闵行区| 孝感市| 宜川县| 眉山市| 尼勒克县| 南宁市| 黑河市| 孟村| 阳原县| 沈丘县| 盐边县| 黔南| 桦南县| 靖宇县| 梁山县| 鲁山县| 乐至县| 大石桥市| 通榆县| 潮州市| 兖州市| 鸡西市| 长阳| 闽侯县| 额敏县| 岱山县| 绥江县| 曲阜市| 博客| 东阳市| 休宁县|