# echo "alias docker=\"sudo /usr/bin/docker\"" > /home/docker_user/. # echo "docker_user ALL=(ALL) NOPASSWD: /usr/bin/docker" > /etc/sudoers sudo systemctl disable rvice sudo systemctl disable rvice. To stop this behavior, use disable instead. In this case we want to run the docker commands from a user called "docker_user", so we add an entry in the "/etc/sudoers" file and use an alias in the user's ".bash_profile" file so we don't have to keep typing the "sudo" command. To automatically start Docker and containerd on boot for other Linux distributions using systemd, run the following commands: sudo systemctl enable rvice sudo systemctl enable rvice. The documentation says, "Warning: The docker group grants privileges equivalent to the root user", so we should avoid this. Create a group called docker and assign that to the user you want to run docker commands from.Allow another user to perform "sudo" on the docker command, so all commands are run using "sudo docker.Run the docker commands from the root user.You have three choices when if comes to running docker commands. ![]() You are now ready to start using Docker! Docker Commands as Non-Root Userĭocker commands run as the "root" user. You can get information about docker using the following commands. I could build the file system on this disk directly, but I prefer to partition the disks with a single partition using fdisk.Įcho -e "n\np\n1\n\n\nw" | fdisk $ xfs defaults 1 2" > /etc/fstab ![]() I have a second LUN with a device named "/dev/sdb". To do this you are going to need the yum-utils package.ĭnf install -y docker-ce -nobest Configure Disk (Optional)īy default the containers are created under the "/var/lib/docker", so you really need to house this on a separate disk or in a separate partition. In this article we have a separate virtual disk.Įnable all the required repositories. You have a separate partition to hold the images and containers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |