mirror of https://github.com/docker/docs.git
Update rhel.md
This commit is contained in:
parent
f6f3fdbfb7
commit
bb83c5f605
|
@ -44,15 +44,15 @@ which also installs via the `yum` package manager.
|
||||||
|
|
||||||
### Install with yum
|
### Install with yum
|
||||||
|
|
||||||
1. Log into your machine as a user with `sudo` or `root` privileges.
|
1. Log into your machine as a user with `sudo` or `root` privileges.
|
||||||
|
|
||||||
2. Make sure your existing packages are up-to-date.
|
2. Make sure your existing packages are up-to-date.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo yum update
|
$ sudo yum update
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Add the `yum` repo.
|
3. Add the `yum` repo.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
|
$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
|
||||||
|
@ -65,19 +65,19 @@ which also installs via the `yum` package manager.
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Install the Docker package.
|
4. Install the Docker package.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo yum install docker-engine
|
$ sudo yum install docker-engine
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Enable the service.
|
5. Enable the service.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo systemctl enable docker.service
|
$ sudo systemctl enable docker.service
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Start the Docker daemon.
|
6. Start the Docker daemon.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo systemctl start docker
|
$ sudo systemctl start docker
|
||||||
|
@ -119,15 +119,15 @@ learn how to [customize your Systemd Docker daemon options](../../admin/systemd.
|
||||||
|
|
||||||
### Install with the script
|
### Install with the script
|
||||||
|
|
||||||
1. Log into your machine as a user with `sudo` or `root` privileges.
|
1. Log into your machine as a user with `sudo` or `root` privileges.
|
||||||
|
|
||||||
2. Make sure your existing packages are up-to-date.
|
2. Make sure your existing packages are up-to-date.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo yum update
|
$ sudo yum update
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Run the Docker installation script.
|
3. Run the Docker installation script.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ curl -fsSL https://get.docker.com/ | sh
|
$ curl -fsSL https://get.docker.com/ | sh
|
||||||
|
@ -135,19 +135,19 @@ learn how to [customize your Systemd Docker daemon options](../../admin/systemd.
|
||||||
|
|
||||||
This script adds the `docker.repo` repository and installs Docker.
|
This script adds the `docker.repo` repository and installs Docker.
|
||||||
|
|
||||||
4. Enable the service.
|
4. Enable the service.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo systemctl enable docker.service
|
$ sudo systemctl enable docker.service
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Start the Docker daemon.
|
5. Start the Docker daemon.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo systemctl start docker
|
$ sudo systemctl start docker
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Verify `docker` is installed correctly by running a test image in a container.
|
6. Verify `docker` is installed correctly by running a test image in a container.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo docker run hello-world
|
$ sudo docker run hello-world
|
||||||
|
@ -173,25 +173,25 @@ makes the ownership of the Unix socket read/writable by the `docker` group.
|
||||||
|
|
||||||
To create the `docker` group and add your user:
|
To create the `docker` group and add your user:
|
||||||
|
|
||||||
1. Log into your machine as a user with `sudo` or `root` privileges.
|
1. Log into your machine as a user with `sudo` or `root` privileges.
|
||||||
|
|
||||||
2. Create the `docker` group.
|
2. Create the `docker` group.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo groupadd docker
|
$ sudo groupadd docker
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Add your user to `docker` group.
|
3. Add your user to `docker` group.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo usermod -aG docker your_username`
|
$ sudo usermod -aG docker your_username`
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Log out and log back in.
|
4. Log out and log back in.
|
||||||
|
|
||||||
This ensures your user is running with the correct permissions.
|
This ensures your user is running with the correct permissions.
|
||||||
|
|
||||||
5. Verify that your user is in the docker group by running `docker` without `sudo`.
|
5. Verify that your user is in the docker group by running `docker` without `sudo`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker run hello-world
|
$ docker run hello-world
|
||||||
|
@ -209,7 +209,7 @@ $ sudo systemctl enable docker
|
||||||
|
|
||||||
You can uninstall the Docker software with `yum`.
|
You can uninstall the Docker software with `yum`.
|
||||||
|
|
||||||
1. List the installed Docker packages.
|
1. List the installed Docker packages.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ yum list installed | grep docker
|
$ yum list installed | grep docker
|
||||||
|
@ -217,7 +217,7 @@ You can uninstall the Docker software with `yum`.
|
||||||
docker-engine.x86_64 1.7.1-0.1.el7@/docker-engine-1.7.1-0.1.el7.x86_64
|
docker-engine.x86_64 1.7.1-0.1.el7@/docker-engine-1.7.1-0.1.el7.x86_64
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Remove the package.
|
2. Remove the package.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo yum -y remove docker-engine.x86_64
|
$ sudo yum -y remove docker-engine.x86_64
|
||||||
|
@ -226,7 +226,7 @@ You can uninstall the Docker software with `yum`.
|
||||||
This command does not remove images, containers, volumes, or user-created
|
This command does not remove images, containers, volumes, or user-created
|
||||||
configuration files on your host.
|
configuration files on your host.
|
||||||
|
|
||||||
3. To delete all images, containers, and volumes, run the following command:
|
3. To delete all images, containers, and volumes, run the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ rm -rf /var/lib/docker
|
$ rm -rf /var/lib/docker
|
||||||
|
|
Loading…
Reference in New Issue