mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
First pass of updates
Working docs Update after check update to centos 7 after second test Updating with hopefully correct urls Adding thaJetzah's comments Updating with the new images Updating after a visual check Signed-off-by: Mary Anthony <mary@docker.com> Updating with comments Signed-off-by: Mary Anthony <mary@docker.com>
This commit is contained in:
parent
b6531d4ec3
commit
f9ab04ad13
3 changed files with 441 additions and 271 deletions
|
@ -12,153 +12,185 @@ parent = "smn_linux"
|
|||
|
||||
Docker is supported on the following versions of CentOS:
|
||||
|
||||
- [*CentOS 7 (64-bit)*](#installing-docker-centos-7)
|
||||
- [*CentOS 6.5 (64-bit)*](#installing-docker-centos-6.5) or later
|
||||
* CentOS 7.X
|
||||
* CentOS 6.5 or higher
|
||||
|
||||
These instructions are likely work for other binary compatible EL6/EL7 distributions
|
||||
such as Scientific Linux, but they haven't been tested.
|
||||
Installation on other binary compatible EL6/EL7 distributions such as Scientific
|
||||
Linux might succeed, but Docker does not test or support Docker on these
|
||||
distributions.
|
||||
|
||||
Please note that due to the current Docker limitations, Docker is able to
|
||||
run only on the **64 bit** architecture.
|
||||
This page instructs you to install using Docker-managed release packages and
|
||||
installation mechanisms. Using these packages ensures you get the latest release
|
||||
of Docker. If you wish to install using CentOS-managed packages, consult your
|
||||
CentOS documentation.
|
||||
|
||||
## Kernel support
|
||||
## Prerequisites
|
||||
|
||||
Currently the CentOS project will only support Docker when running on kernels
|
||||
shipped by the distribution. There are kernel changes which will cause issues
|
||||
if one decides to step outside that box and run non-distribution kernel packages.
|
||||
Docker requires a 64-bit installation regardless of your CentOS version. Also,
|
||||
your kernel must be 3.10 at minimum. CentOS 7 runs the 3.10 kernel, 6.5 does
|
||||
not. We make an exception for CentOS 6.5. To run Docker on
|
||||
[CentOS-6.5](https://www.centos.org) or later, you need kernel 2.6.32-431 or
|
||||
higher.
|
||||
|
||||
To run Docker on [CentOS-6.5](http://www.centos.org) or later, you will need
|
||||
kernel version 2.6.32-431 or higher as this has specific kernel fixes to allow
|
||||
Docker to run.
|
||||
To check your current kernel version, open a terminal and use `uname -r` to
|
||||
display your kernel version:
|
||||
|
||||
## CentOS-7
|
||||
$ uname -r
|
||||
2.6.32-431.el6.x86_64
|
||||
|
||||
### Installation
|
||||
Finally, is it recommended that you fully update your system. Please keep in
|
||||
mind that CentOS 6 should be fully patched to fix any potential kernel bugs. Any
|
||||
reported kernel bugs may have already been fixed on the latest kernel packages
|
||||
|
||||
Docker is included by default in the CentOS-Extras repository. To install
|
||||
run the following command:
|
||||
## Install
|
||||
|
||||
$ sudo yum install docker
|
||||
You use the same installation procedure for all versions of CentOS,
|
||||
only the package you install differs. There are two packages to choose from:
|
||||
|
||||
Please continue with the [Starting the Docker daemon](#starting-the-docker-daemon).
|
||||
<table>
|
||||
<tr>
|
||||
<th>Version</th>
|
||||
<th>Package name</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>6.5 and higher</td>
|
||||
<td>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/centos-6/RPMS/x86_64/docker-engine-1.7.0-1.el6.x86_64.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/centos-6/RPMS/x86_64/docker-engine-1.7.0-1.el6.x86_64.rpm</a>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/centos-6/SRPMS/docker-engine-1.7.0-1.el6.src.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/centos-6/SRPMS/docker-engine-1.7.0-1.el6.src.rpm</a>
|
||||
<p>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>7.X</td>
|
||||
<td>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/centos-7/RPMS/x86_64/docker-engine-1.7.0-1.el7.centos.x86_64.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/centos-7/RPMS/x86_64/docker-engine-1.7.0-1.el7.centos.x86_64.rpm</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/centos-7/SRPMS/docker-engine-1.7.0-1.el7.centos.src.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/centos-7/SRPMS/docker-engine-1.7.0-1.el7.centos.src.rpm</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Uninstallation
|
||||
|
||||
To uninstall the Docker package:
|
||||
This procedure depicts an installation on version 6.5. If you are installing on
|
||||
7.X, substitute that package for your installation.
|
||||
|
||||
$ sudo yum -y remove docker
|
||||
1. Log into your machine as a user with `sudo` or `root` privileges.
|
||||
|
||||
The above command will not remove images, containers, volumes, or user created
|
||||
configuration files on your host. If you wish to delete all images, containers,
|
||||
and volumes run the following command:
|
||||
2. Make sure your existing packages are up-to-date.
|
||||
|
||||
$ rm -rf /var/lib/docker
|
||||
$ sudo yum update
|
||||
|
||||
3. Download the Docker RPM to the current directory.
|
||||
|
||||
$ curl -O -sSL https://get.docker.com/rpm/1.7.0/centos-6/RPMS/x86_64/docker-engine-1.7.0-1.el6.x86_64.rpm
|
||||
|
||||
You must delete the user created configuration files manually.
|
||||
4. Use `yum` to install the package.
|
||||
|
||||
## CentOS-6.5
|
||||
$ sudo yum localinstall --nogpgcheck docker-engine-1.7.0-1.el6.x86_64.rpm
|
||||
|
||||
### Installation
|
||||
5. Start the Docker daemon.
|
||||
|
||||
For CentOS-6.5, the Docker package is part of [Extra Packages
|
||||
for Enterprise Linux (EPEL)](https://fedoraproject.org/wiki/EPEL) repository,
|
||||
a community effort to create and maintain additional packages for the RHEL distribution.
|
||||
$ sudo service docker start
|
||||
|
||||
Firstly, you need to ensure you have the EPEL repository enabled. Please
|
||||
follow the [EPEL installation instructions](
|
||||
https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F).
|
||||
6. Verify `docker` is installed correctly by running a test image in a container.
|
||||
|
||||
For CentOS-6, there is a package name conflict with a system tray application
|
||||
and its executable, so the Docker RPM package was called `docker-io`.
|
||||
$ sudo docker run hello-world
|
||||
Unable to find image 'hello-world:latest' locally
|
||||
latest: Pulling from hello-world
|
||||
a8219747be10: Pull complete
|
||||
91c95931e552: Already exists
|
||||
hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
|
||||
Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd1.7.0cf5daeb82aab55838d
|
||||
Status: Downloaded newer image for hello-world:latest
|
||||
Hello from Docker.
|
||||
This message shows that your installation appears to be working correctly.
|
||||
|
||||
To proceed with `docker-io` installation on CentOS-6, you may need to remove the
|
||||
`docker` package first.
|
||||
To generate this message, Docker took the following steps:
|
||||
1. The Docker client contacted the Docker daemon.
|
||||
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
|
||||
(Assuming it was not already locally available.)
|
||||
3. The Docker daemon created a new container from that image which runs the
|
||||
executable that produces the output you are currently reading.
|
||||
4. The Docker daemon streamed that output to the Docker client, which sent it
|
||||
to your terminal.
|
||||
|
||||
$ sudo yum -y remove docker
|
||||
To try something more ambitious, you can run an Ubuntu container with:
|
||||
$ docker run -it ubuntu bash
|
||||
|
||||
Next, let's install the `docker-io` package which will install Docker on our host.
|
||||
For more examples and ideas, visit:
|
||||
http://docs.docker.com/userguide/
|
||||
|
||||
## Create a docker group
|
||||
|
||||
$ sudo yum install docker-io
|
||||
The `docker` daemon binds to a Unix socket instead of a TCP port. By default
|
||||
that Unix socket is owned by the user `root` and other users can access it with
|
||||
`sudo`. For this reason, `docker` daemon always runs as the `root` user.
|
||||
|
||||
Please continue with the [Starting the Docker daemon](#starting-the-docker-daemon).
|
||||
To avoid having to use `sudo` when you use the `docker` command, create a Unix
|
||||
group called `docker` and add users to it. When the `docker` daemon starts, it
|
||||
makes the ownership of the Unix socket read/writable by the `docker` group.
|
||||
|
||||
### Uninstallation
|
||||
>**Warning**: The `docker` group is equivalent to the `root` user; For details
|
||||
>on how this impacts security in your system, see [*Docker Daemon Attack
|
||||
>Surface*](/articles/security/#docker-daemon-attack-surface) for details.
|
||||
|
||||
To uninstall the Docker package:
|
||||
To create the `docker` group and add your user:
|
||||
|
||||
$ sudo yum -y remove docker-io
|
||||
1. Log into Centos as a user with `sudo` privileges.
|
||||
|
||||
The above command will not remove images, containers, volumes, or user created
|
||||
configuration files on your host. If you wish to delete all images, containers,
|
||||
and volumes run the following command:
|
||||
2. Create the `docker` group and add your user.
|
||||
|
||||
$ rm -rf /var/lib/docker
|
||||
`sudo usermod -aG docker your_username`
|
||||
|
||||
You must delete the user created configuration files manually.
|
||||
3. Log out and log back in.
|
||||
|
||||
## Manual installation of latest Docker release
|
||||
This ensures your user is running with the correct permissions.
|
||||
|
||||
While using a package is the recommended way of installing Docker,
|
||||
the above package might not be the current release version. If you need the latest
|
||||
version, [you can install the binary directly](
|
||||
https://docs.docker.com/installation/binaries/).
|
||||
4. Verify your work by running `docker` without `sudo`.
|
||||
|
||||
When installing the binary without a package, you may want
|
||||
to integrate Docker with Systemd. For this, install the two unit files
|
||||
(service and socket) from [the GitHub
|
||||
repository](https://github.com/docker/docker/tree/master/contrib/init/systemd)
|
||||
to `/etc/systemd/system`.
|
||||
$ docker run hello-world
|
||||
|
||||
## Start the docker daemon at boot
|
||||
|
||||
Please continue with the [Starting the Docker daemon](#starting-the-docker-daemon).
|
||||
To ensure Docker starts when you boot your system, do the following:
|
||||
|
||||
## Starting the Docker daemon
|
||||
|
||||
Once Docker is installed, you will need to start the docker daemon.
|
||||
|
||||
$ sudo service docker start
|
||||
|
||||
If we want Docker to start at boot, we should also:
|
||||
|
||||
$ sudo chkconfig docker on
|
||||
|
||||
Now let's verify that Docker is working. First we'll need to get the latest
|
||||
`centos` image.
|
||||
|
||||
$ sudo docker pull centos
|
||||
|
||||
Next we'll make sure that we can see the image by running:
|
||||
|
||||
$ sudo docker images centos
|
||||
|
||||
This should generate some output similar to:
|
||||
|
||||
$ sudo docker images centos
|
||||
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
||||
centos latest 0b443ba03958 2 hours ago 297.6 MB
|
||||
|
||||
Run a simple bash shell to test the image:
|
||||
|
||||
$ sudo docker run -i -t centos /bin/bash
|
||||
|
||||
If everything is working properly, you'll get a simple bash prompt. Type
|
||||
`exit` to continue.
|
||||
|
||||
## Custom daemon options
|
||||
$ sudo chkconfig docker on
|
||||
|
||||
If you need to add an HTTP Proxy, set a different directory or partition for the
|
||||
Docker runtime files, or make other customizations, read our Systemd article to
|
||||
learn how to [customize your Systemd Docker daemon options](/articles/systemd/).
|
||||
|
||||
## Dockerfiles
|
||||
The CentOS Project provides a number of sample Dockerfiles which you may use
|
||||
either as templates or to familiarize yourself with docker. These templates
|
||||
are available on GitHub at [https://github.com/CentOS/CentOS-Dockerfiles](
|
||||
https://github.com/CentOS/CentOS-Dockerfiles)
|
||||
|
||||
**Done!** You can either continue with the [Docker User
|
||||
Guide](/userguide/) or explore and build on the images yourself.
|
||||
## Uninstall
|
||||
|
||||
## Issues?
|
||||
You can uninstall the Docker software with `yum`.
|
||||
|
||||
If you have any issues - please report them directly in the
|
||||
[CentOS bug tracker](http://bugs.centos.org).
|
||||
1. List the package you have installed.
|
||||
|
||||
$ yum list installed | grep docker
|
||||
yum list installed | grep docker
|
||||
docker-engine.x86_64 1.7.0-1.el6
|
||||
@/docker-engine-1.7.0-1.el6.x86_64.rpm
|
||||
|
||||
2. Remove the package.
|
||||
|
||||
$ sudo yum -y remove docker-engine.x86_64
|
||||
|
||||
This command does not remove images, containers, volumes, or user-created
|
||||
configuration files on your host.
|
||||
|
||||
3. To delete all images, containers, and volumes, run the following command:
|
||||
|
||||
$ rm -rf /var/lib/docker
|
||||
|
||||
4. Locate and delete any user-created configuration files.
|
|
@ -12,111 +12,221 @@ parent = "smn_linux"
|
|||
|
||||
Docker is supported on the following versions of Fedora:
|
||||
|
||||
- [*Fedora 20 (64-bit)*](#fedora-20-installation)
|
||||
- [*Fedora 21 and later (64-bit)*](#fedora-21-and-later-installation)
|
||||
- Fedora 20
|
||||
- Fedora 21
|
||||
- Fedora 22
|
||||
|
||||
Currently the Fedora project will only support Docker when running on kernels
|
||||
shipped by the distribution. There are kernel changes which will cause issues
|
||||
if one decides to step outside that box and run non-distribution kernel packages.
|
||||
This page instructs you to install using Docker-managed release packages and
|
||||
installation mechanisms. Using these packages ensures you get the latest release
|
||||
of Docker. If you wish to install using Fedora-managed packages, consult your
|
||||
Fedora release documentation for information on Fedora's Docker support.
|
||||
|
||||
## Fedora 21 and later
|
||||
##Prerequisites
|
||||
|
||||
### Installation
|
||||
Docker requires a 64-bit installation regardless of your Fedora version. Also, your kernel must be 3.10 at minimum. To check your current kernel
|
||||
version, open a terminal and use `uname -r` to display your kernel version:
|
||||
|
||||
Install the Docker package which will install Docker on our host.
|
||||
$ uname -r
|
||||
3.19.5-100.fc20.x86_64
|
||||
|
||||
$ sudo yum -y install docker
|
||||
If your kernel is at a older version, you must update it.
|
||||
|
||||
To update the Docker package:
|
||||
Finally, is it recommended that you fully update your system. Please keep in
|
||||
mind that your system should be fully patched to fix any potential kernel bugs. Any
|
||||
reported kernel bugs may have already been fixed on the latest kernel packages
|
||||
|
||||
$ sudo yum -y update docker
|
||||
|
||||
Please continue with the [Starting the Docker daemon](#starting-the-docker-daemon).
|
||||
## Install
|
||||
|
||||
### Uninstallation
|
||||
You use the same installation procedure for all versions of Fedora,
|
||||
only the package you install differs. There are two packages to choose from:
|
||||
|
||||
To uninstall the Docker package:
|
||||
<table>
|
||||
<tr>
|
||||
<th>Version</th>
|
||||
<th>Package name</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fedora 20</td>
|
||||
<td>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/fedora-20/RPMS/x86_64/docker-engine-1.7.0-1.fc20.x86_64.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/fedora-20/RPMS/x86_64/docker-engine-1.7.0-1.fc20.x86_64.rpm</a>
|
||||
</p>
|
||||
</td>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/fedora-20/SRPMS/docker-engine-1.7.0-1.fc20.src.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/fedora-20/SRPMS/docker-engine-1.7.0-1.fc20.src.rpm/a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fedora 21</td>
|
||||
<td>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/fedora-21/RPMS/x86_64/docker-engine-1.7.0-1.fc21.x86_64.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/fedora-21/RPMS/x86_64/docker-engine-1.7.0-1.fc21.x86_64.rpm</a>
|
||||
</p>
|
||||
</td>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/fedora-21/SRPMS/docker-engine-1.7.0-1.fc21.src.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/fedora-21/SRPMS/docker-engine-1.7.0-1.fc21.src.rpm/a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fedora 22</td>
|
||||
<td>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/fedora-22/RPMS/x86_64/docker-engine-1.7.0-1.fc22.x86_64.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/fedora-22/RPMS/x86_64/docker-engine-1.7.0-1.fc22.x86_64.rpm</a>
|
||||
</p>
|
||||
</td>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/fedora-22/SRPMS/docker-engine-1.7.0-1.fc22.src.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/fedora-22/SRPMS/docker-engine-1.7.0-1.fc22.src.rpm/a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
$ sudo yum -y remove docker
|
||||
|
||||
The above command will not remove images, containers, volumes, or user created
|
||||
configuration files on your host. If you wish to delete all images, containers,
|
||||
and volumes run the following command:
|
||||
This procedure depicts an installation on version 21. If you are installing on
|
||||
20 or 22, substitute that package for your installation.
|
||||
|
||||
$ rm -rf /var/lib/docker
|
||||
1. Log into your machine as a user with `sudo` or `root` privileges.
|
||||
|
||||
You must delete the user created configuration files manually.
|
||||
2. Make sure you don't have an older version of Docker installed.
|
||||
|
||||
## Fedora 20
|
||||
$ yum list installed | grep docker
|
||||
|
||||
If you have an older version, remove it using the `yum -y remove <packagename>` command.
|
||||
|
||||
### Installation
|
||||
3. Download the Docker RPM to the current directory.
|
||||
|
||||
$ curl -O -sSL https://url_to_package/docker-engine-1.7.0-0.1.fc21.x86_64.rpm
|
||||
|
||||
For `Fedora 20`, there is a package name conflict with a system tray application
|
||||
and its executable, so the Docker RPM package was called `docker-io`.
|
||||
4. Use `yum` to install the package.
|
||||
|
||||
To proceed with `docker-io` installation on Fedora 20, please remove the `docker`
|
||||
package first.
|
||||
$ sudo yum localinstall --nogpgcheck docker-engine-1.7.0-0.1.fc21.x86_64.rpm
|
||||
|
||||
$ sudo yum -y remove docker
|
||||
$ sudo yum -y install docker-io
|
||||
5. Start the Docker daemon.
|
||||
|
||||
To update the Docker package:
|
||||
$ sudo service docker start
|
||||
|
||||
$ sudo yum -y update docker-io
|
||||
6. Verify `docker` is installed correctly by running a test image in a container.
|
||||
|
||||
Please continue with the [Starting the Docker daemon](#starting-the-docker-daemon).
|
||||
$ sudo docker run hello-world
|
||||
Unable to find image 'hello-world:latest' locally
|
||||
latest: Pulling from hello-world
|
||||
a8219747be10: Pull complete
|
||||
91c95931e552: Already exists
|
||||
hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
|
||||
Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd18681cf5daeb82aab55838d
|
||||
Status: Downloaded newer image for hello-world:latest
|
||||
Hello from Docker.
|
||||
This message shows that your installation appears to be working correctly.
|
||||
|
||||
### Uninstallation
|
||||
To generate this message, Docker took the following steps:
|
||||
1. The Docker client contacted the Docker daemon.
|
||||
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
|
||||
(Assuming it was not already locally available.)
|
||||
3. The Docker daemon created a new container from that image which runs the
|
||||
executable that produces the output you are currently reading.
|
||||
4. The Docker daemon streamed that output to the Docker client, which sent it
|
||||
to your terminal.
|
||||
|
||||
To uninstall the Docker package:
|
||||
To try something more ambitious, you can run an Ubuntu container with:
|
||||
$ docker run -it ubuntu bash
|
||||
|
||||
$ sudo yum -y remove docker-io
|
||||
For more examples and ideas, visit:
|
||||
http://docs.docker.com/userguide/
|
||||
|
||||
## Create a docker group
|
||||
|
||||
The above command will not remove images, containers, volumes, or user created
|
||||
configuration files on your host. If you wish to delete all images, containers,
|
||||
and volumes run the following command:
|
||||
The `docker` daemon binds to a Unix socket instead of a TCP port. By default
|
||||
that Unix socket is owned by the user `root` and other users can access it with
|
||||
`sudo`. For this reason, `docker` daemon always runs as the `root` user.
|
||||
|
||||
$ rm -rf /var/lib/docker
|
||||
To avoid having to use `sudo` when you use the `docker` command, create a Unix
|
||||
group called `docker` and add users to it. When the `docker` daemon starts, it
|
||||
makes the ownership of the Unix socket read/writable by the `docker` group.
|
||||
|
||||
You must delete the user created configuration files manually.
|
||||
>**Warning**: The `docker` group is equivalent to the `root` user; For details
|
||||
>on how this impacts security in your system, see [*Docker Daemon Attack
|
||||
>Surface*](/articles/security/#docker-daemon-attack-surface) for details.
|
||||
|
||||
## Starting the Docker daemon
|
||||
To create the `docker` group and add your user:
|
||||
|
||||
Now that it's installed, let's start the Docker daemon.
|
||||
1. Log into your system as a user with `sudo` privileges.
|
||||
|
||||
$ sudo systemctl start docker
|
||||
2. Create the `docker` group and add your user.
|
||||
|
||||
If we want Docker to start at boot, we should also:
|
||||
`sudo usermod -aG docker your_username`
|
||||
|
||||
$ sudo systemctl enable docker
|
||||
3. Log out and log back in.
|
||||
|
||||
Now let's verify that Docker is working.
|
||||
This ensures your user is running with the correct permissions.
|
||||
|
||||
$ sudo docker run -i -t fedora /bin/bash
|
||||
4. Verify your work by running `docker` without `sudo`.
|
||||
|
||||
> Note: If you get a `Cannot start container` error mentioning SELinux
|
||||
> or permission denied, you may need to update the SELinux policies.
|
||||
> This can be done using `sudo yum upgrade selinux-policy` and then rebooting.
|
||||
$ docker run hello-world
|
||||
Unable to find image 'hello-world:latest' locally
|
||||
latest: Pulling from hello-world
|
||||
a8219747be10: Pull complete
|
||||
91c95931e552: Already exists
|
||||
hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
|
||||
Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd18681cf5daeb82aab55838d
|
||||
Status: Downloaded newer image for hello-world:latest
|
||||
Hello from Docker.
|
||||
This message shows that your installation appears to be working correctly.
|
||||
|
||||
## Granting rights to users to use Docker
|
||||
To generate this message, Docker took the following steps:
|
||||
1. The Docker client contacted the Docker daemon.
|
||||
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
|
||||
(Assuming it was not already locally available.)
|
||||
3. The Docker daemon created a new container from that image which runs the
|
||||
executable that produces the output you are currently reading.
|
||||
4. The Docker daemon streamed that output to the Docker client, which sent it
|
||||
to your terminal.
|
||||
|
||||
The `docker` command line tool contacts the `docker` daemon process via a
|
||||
socket file `/var/run/docker.sock` owned by `root:root`. Though it's
|
||||
[recommended](https://lists.projectatomic.io/projectatomic-archives/atomic-devel/2015-January/msg00034.html)
|
||||
to use `sudo` for docker commands, if users wish to avoid it, an administrator can
|
||||
create a `docker` group, have it own `/var/run/docker.sock`, and add users to this group.
|
||||
To try something more ambitious, you can run an Ubuntu container with:
|
||||
$ docker run -it ubuntu bash
|
||||
|
||||
$ sudo groupadd docker
|
||||
$ sudo chown root:docker /var/run/docker.sock
|
||||
$ sudo usermod -a -G docker $USERNAME
|
||||
For more examples and ideas, visit:
|
||||
http://docs.docker.com/userguide/
|
||||
|
||||
## Start the docker daemon at boot
|
||||
|
||||
## Custom daemon options
|
||||
To ensure Docker starts when you boot your system, do the following:
|
||||
|
||||
$ sudo chkconfig docker on
|
||||
|
||||
If you need to add an HTTP Proxy, set a different directory or partition for the
|
||||
Docker runtime files, or make other customizations, read our Systemd article to
|
||||
learn how to [customize your Systemd Docker daemon options](/articles/systemd/).
|
||||
|
||||
## What next?
|
||||
|
||||
Continue with the [User Guide](/userguide/).
|
||||
## Uninstall
|
||||
|
||||
You can uninstall the Docker software with `yum`.
|
||||
|
||||
1. List the package you have installed.
|
||||
|
||||
$ yum list installed | grep docker
|
||||
yum list installed | grep docker
|
||||
docker-engine.x86_64 1.7.0-0.1.fc20
|
||||
@/docker-engine-1.7.0-0.1.fc20.el6.x86_64
|
||||
|
||||
2. Remove the package.
|
||||
|
||||
$ sudo yum -y remove docker-engine.x86_64
|
||||
|
||||
This command does not remove images, containers, volumes, or user-created
|
||||
configuration files on your host.
|
||||
|
||||
3. To delete all images, containers, and volumes, run the following command:
|
||||
|
||||
$ rm -rf /var/lib/docker
|
||||
|
||||
4. Locate and delete any user-created configuration files.
|
||||
|
|
|
@ -12,150 +12,178 @@ parent = "smn_linux"
|
|||
|
||||
Docker is supported on the following versions of RHEL:
|
||||
|
||||
- [*Red Hat Enterprise Linux 7 (64-bit)*](#red-hat-enterprise-linux-7-installation)
|
||||
- [*Red Hat Enterprise Linux 6.6 (64-bit)*](#red-hat-enterprise-linux-66-installation) or later
|
||||
- Red Hat Enterprise Linux 7
|
||||
- Red Hat Enterprise Linux 6.6 or later
|
||||
|
||||
## Kernel support
|
||||
This page instructs you to install using Docker-managed release packages and
|
||||
installation mechanisms. Using these packages ensures you get the latest release
|
||||
of Docker. If you wish to install using Red Hat-managed packages, consult your
|
||||
Red Hat release documentation for information on Red Hat's Docker support.
|
||||
|
||||
RHEL will only support Docker via the *extras* channel or EPEL package when
|
||||
running on kernels shipped by the distribution. There are kernel changes which
|
||||
will cause issues if one decides to step outside that box and run
|
||||
non-distribution kernel packages.
|
||||
## Prerequisites
|
||||
|
||||
## Red Hat Enterprise Linux 7
|
||||
Docker requires a 64-bit installation regardless of your Red Hat version. Docker
|
||||
requires that your kernel must be 3.10 at minimum. Red Hat 7 runs the 3.10
|
||||
kernel, 6.6 does not. We make an exception for Red Hat 6.6. To run Docker on
|
||||
[Red Hat-6.6](http://www.centos.org) or later, you need kernel 2.6.32-431 or
|
||||
higher.
|
||||
|
||||
### Installation
|
||||
To check your current kernel version, open a terminal and use `uname -r` to
|
||||
display your kernel version:
|
||||
|
||||
**Red Hat Enterprise Linux 7 (64 bit)** has [shipped with
|
||||
Docker](https://access.redhat.com/site/products/red-hat-enterprise-linux/docker-and-containers).
|
||||
An overview and some guidance can be found in the [Release
|
||||
Notes](https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/7.0_Release_Notes/chap-Red_Hat_Enterprise_Linux-7.0_Release_Notes-Linux_Containers_with_Docker_Format.html).
|
||||
$ uname -r
|
||||
3.10.0-229.el7.x86_64
|
||||
|
||||
Docker is located in the *extras* channel. To install Docker:
|
||||
Finally, is it recommended that you fully update your system. Please keep in
|
||||
mind that your system should be fully patched to fix any potential kernel bugs.
|
||||
Any reported kernel bugs may have already been fixed on the latest kernel
|
||||
packages
|
||||
|
||||
1. Enable the *extras* channel:
|
||||
|
||||
$ sudo subscription-manager repos --enable=rhel-7-server-extras-rpms
|
||||
## Install
|
||||
|
||||
2. Install Docker:
|
||||
You use the same installation procedure for all versions of Red Hat Enterprise,
|
||||
only the package you install differs. There are two packages to choose from:
|
||||
|
||||
$ sudo yum install docker
|
||||
<table>
|
||||
<tr>
|
||||
<th>Version</th>
|
||||
<th>Package name</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>6.6 and higher</td>
|
||||
<td>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/centos-6/RPMS/x86_64/docker-engine-1.7.0-1.el6.x86_64.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/centos-6/RPMS/x86_64/docker-engine-1.7.0-1.el6.x86_64.rpm</a>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/centos-6/SRPMS/docker-engine-1.7.0-1.el6.src.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/centos-6/SRPMS/docker-engine-1.7.0-1.el6.src.rpm</a>
|
||||
<p>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>7.X</td>
|
||||
<td>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/centos-7/RPMS/x86_64/docker-engine-1.7.0-1.el7.centos.x86_64.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/centos-7/RPMS/x86_64/docker-engine-1.7.0-1.el7.centos.x86_64.rpm</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://get.docker.com/rpm/1.7.0/centos-7/SRPMS/docker-engine-1.7.0-1.el7.centos.src.rpm">
|
||||
https://get.docker.com/rpm/1.7.0/centos-7/SRPMS/docker-engine-1.7.0-1.el7.centos.src.rpm</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Additional installation, configuration, and usage information,
|
||||
including a [Get Started with Docker Containers in Red Hat
|
||||
Enterprise Linux 7](https://access.redhat.com/site/articles/881893)
|
||||
guide, can be found by Red Hat customers on the [Red Hat Customer
|
||||
Portal](https://access.redhat.com/).
|
||||
This procedure depicts an installation on version 6.6. If you are installing on
|
||||
7.X, substitute that package for your installation.
|
||||
|
||||
Please continue with the [Starting the Docker daemon](#starting-the-docker-daemon).
|
||||
1. Log into your machine as a user with `sudo` or `root` privileges.
|
||||
|
||||
### Uninstallation
|
||||
2. Download the Docker RPM to the current directory.
|
||||
|
||||
$ curl -O -sSL http://get.docker.com/docker/1.7.0/rpms/centos-6/RPMS/x86_64/docker-engine-1.7.0-0.1.el6.x86_64.rpm
|
||||
|
||||
To uninstall the Docker package:
|
||||
3. Use `yum` to install the package.
|
||||
|
||||
$ sudo yum -y remove docker
|
||||
$ sudo yum localinstall --nogpgcheck docker-engine-1.7.0-0.1.el6.x86_64.rpm
|
||||
|
||||
The above command will not remove images, containers, volumes, or user created
|
||||
configuration files on your host. If you wish to delete all images, containers,
|
||||
and volumes run the following command:
|
||||
5. Start the Docker daemon.
|
||||
|
||||
$ rm -rf /var/lib/docker
|
||||
$ sudo service docker start
|
||||
|
||||
You must delete the user created configuration files manually.
|
||||
6. Verify `docker` is installed correctly.
|
||||
|
||||
## Red Hat Enterprise Linux 6.6
|
||||
$ sudo docker run hello-world
|
||||
Unable to find image 'hello-world:latest' locally
|
||||
latest: Pulling from hello-world
|
||||
a8219747be10: Pull complete
|
||||
91c95931e552: Already exists
|
||||
hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
|
||||
Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd18681cf5daeb82aab55838d
|
||||
Status: Downloaded newer image for hello-world:latest
|
||||
Hello from Docker.
|
||||
This message shows that your installation appears to be working correctly.
|
||||
|
||||
You will need **64 bit** [RHEL
|
||||
6.6](https://access.redhat.com/site/articles/3078#RHEL6) or later, with
|
||||
a RHEL 6 kernel version 2.6.32-504.16.2 or higher as this has specific kernel
|
||||
fixes to allow Docker to work. Related issues: [#9856](https://github.com/docker/docker/issues/9856).
|
||||
To generate this message, Docker took the following steps:
|
||||
1. The Docker client contacted the Docker daemon.
|
||||
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
|
||||
(Assuming it was not already locally available.)
|
||||
3. The Docker daemon created a new container from that image which runs the
|
||||
executable that produces the output you are currently reading.
|
||||
4. The Docker daemon streamed that output to the Docker client, which sent it
|
||||
to your terminal.
|
||||
|
||||
Docker is available for **RHEL6.6** on EPEL. Please note that
|
||||
this package is part of [Extra Packages for Enterprise Linux
|
||||
(EPEL)](https://fedoraproject.org/wiki/EPEL), a community effort to
|
||||
create and maintain additional packages for the RHEL distribution.
|
||||
To try something more ambitious, you can run an Ubuntu container with:
|
||||
$ docker run -it ubuntu bash
|
||||
|
||||
### Kernel support
|
||||
For more examples and ideas, visit:
|
||||
http://docs.docker.com/userguide/
|
||||
|
||||
## Create a docker group
|
||||
|
||||
RHEL will only support Docker via the *extras* channel or EPEL package when
|
||||
running on kernels shipped by the distribution. There are things like namespace
|
||||
changes which will cause issues if one decides to step outside that box and run
|
||||
non-distro kernel packages.
|
||||
The `docker` daemon binds to a Unix socket instead of a TCP port. By default
|
||||
that Unix socket is owned by the user `root` and other users can access it with
|
||||
`sudo`. For this reason, `docker` daemon always runs as the `root` user.
|
||||
|
||||
> **Warning**:
|
||||
> Please keep your system up to date using `yum update` and rebooting
|
||||
> your system. Keeping your system updated ensures critical security
|
||||
> vulnerabilities and severe bugs (such as those found in kernel 2.6.32)
|
||||
> are fixed.
|
||||
To avoid having to use `sudo` when you use the `docker` command, create a Unix
|
||||
group called `docker` and add users to it. When the `docker` daemon starts, it
|
||||
makes the ownership of the Unix socket read/writable by the `docker` group.
|
||||
|
||||
### Installation
|
||||
>**Warning**: The `docker` group is equivalent to the `root` user; For details
|
||||
>on how this impacts security in your system, see [*Docker Daemon Attack
|
||||
>Surface*](/articles/security/#docker-daemon-attack-surface) for details.
|
||||
|
||||
Firstly, you need to install the EPEL repository. Please follow the
|
||||
[EPEL installation
|
||||
instructions](https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F).
|
||||
To create the `docker` group and add your user:
|
||||
|
||||
There is a package name conflict with a system tray application
|
||||
and its executable, so the Docker RPM package was called `docker-io`.
|
||||
1. Log into your machine as a user with `sudo` or `root` privileges.
|
||||
|
||||
To proceed with `docker-io` installation, you may need to remove the
|
||||
`docker` package first.
|
||||
2. Create the `docker` group and add your user.
|
||||
|
||||
$ sudo yum -y remove docker
|
||||
`sudo usermod -aG docker your_username`
|
||||
|
||||
Next, let's install the `docker-io` package which will install Docker on our host.
|
||||
3. Log out and log back in.
|
||||
|
||||
$ sudo yum install docker-io
|
||||
This ensures your user is running with the correct permissions.
|
||||
|
||||
To update the `docker-io` package
|
||||
4. Verify your work by running `docker` without `sudo`.
|
||||
|
||||
$ sudo yum -y update docker-io
|
||||
$ docker run hello-world
|
||||
|
||||
## Start the docker daemon at boot
|
||||
|
||||
Please continue with the [Starting the Docker daemon](#starting-the-docker-daemon).
|
||||
|
||||
### Uninstallation
|
||||
|
||||
To uninstall the Docker package:
|
||||
|
||||
$ sudo yum -y remove docker-io
|
||||
|
||||
The above command will not remove images, containers, volumes, or user created
|
||||
configuration files on your host. If you wish to delete all images, containers,
|
||||
and volumes run the following command:
|
||||
|
||||
$ rm -rf /var/lib/docker
|
||||
|
||||
You must delete the user created configuration files manually.
|
||||
|
||||
## Starting the Docker daemon
|
||||
|
||||
Now that it's installed, let's start the Docker daemon.
|
||||
|
||||
$ sudo service docker start
|
||||
|
||||
If we want Docker to start at boot, we should also:
|
||||
To ensure Docker starts when you boot your system, do the following:
|
||||
|
||||
$ sudo chkconfig docker on
|
||||
|
||||
Now let's verify that Docker is working.
|
||||
|
||||
$ sudo docker run -i -t fedora /bin/bash
|
||||
|
||||
> Note: If you get a `Cannot start container` error mentioning SELinux
|
||||
> or permission denied, you may need to update the SELinux policies.
|
||||
> This can be done using `sudo yum upgrade selinux-policy` and then rebooting.
|
||||
|
||||
**Done!**
|
||||
|
||||
Continue with the [User Guide](/userguide/).
|
||||
|
||||
## Custom daemon options
|
||||
|
||||
If you need to add an HTTP Proxy, set a different directory or partition for the
|
||||
Docker runtime files, or make other customizations, read our Systemd article to
|
||||
learn how to [customize your Systemd Docker daemon options](/articles/systemd/).
|
||||
|
||||
## Issues?
|
||||
|
||||
If you have any issues - please report them directly in the
|
||||
[Red Hat Bugzilla for docker-io component](
|
||||
https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=docker-io).
|
||||
## Uninstall
|
||||
|
||||
You can uninstall the Docker software with `yum`.
|
||||
|
||||
1. List the package you have installed.
|
||||
|
||||
$ yum list installed | grep docker
|
||||
yum list installed | grep docker
|
||||
docker-engine.x86_64 1.7.0-0.1.el6
|
||||
@/docker-engine-1.7.0-0.1.el6.x86_64
|
||||
|
||||
2. Remove the package.
|
||||
|
||||
$ sudo yum -y remove docker-engine.x86_64
|
||||
|
||||
This command does not remove images, containers, volumes, or user created
|
||||
configuration files on your host.
|
||||
|
||||
3. To delete all images, containers, and volumes run the following command:
|
||||
|
||||
$ rm -rf /var/lib/docker
|
||||
|
||||
4. Locate and delete any user-created configuration files.
|
Loading…
Reference in a new issue