github.com/ncdc/docker@v0.10.1-0.20160129113957-6c6729ef5b74/docs/installation/linux/oracle.md (about)

     1  <!--[metadata]>
     2  +++
     3  aliases = [ "/engine/installation/oracle/"]
     4  title = "Installation on Oracle Linux"
     5  description = "Installation instructions for Docker on Oracle Linux."
     6  keywords = ["Docker, Docker documentation, requirements, linux, rhel, centos, oracle,  ol"]
     7  [menu.main]
     8  parent = "engine_linux"
     9  +++
    10  <![end-metadata]-->
    11  
    12  # Oracle Linux
    13  
    14  Docker is supported Oracle Linux 6 and 7. You do not require an Oracle Linux
    15  Support subscription to install Docker on Oracle Linux.
    16  
    17  ## Prerequisites
    18  
    19  Due to current Docker limitations, Docker is only able to run only on the x86_64
    20  architecture. Docker requires the use of the Unbreakable Enterprise Kernel
    21  Release 4 (4.1.12) or higher on Oracle Linux. This kernel supports the Docker
    22  btrfs storage engine on both Oracle Linux 6 and 7.
    23  
    24  ## Install
    25  
    26  
    27  > **Note**: The procedure below installs binaries built by Docker. These binaries
    28  > are not covered by Oracle Linux support. To ensure Oracle Linux support, please
    29  > follow the installation instructions provided in the
    30  > [Oracle Linux documentation](https://docs.oracle.com/en/operating-systems/?tab=2).
    31  >
    32  > The installation instructions for Oracle Linux 6 can be found in [Chapter 10 of
    33  > the Administrator&apos;s
    34  > Solutions Guide](https://docs.oracle.com/cd/E37670_01/E37355/html/ol_docker.html)
    35  >
    36  > The installation instructions for Oracle Linux 7 can be found in [Chapter 29 of
    37  > the Administrator&apos;s
    38  > Guide](https://docs.oracle.com/cd/E52668_01/E54669/html/ol7-docker.html)
    39  
    40  
    41  1. Log into your machine as a user with `sudo` or `root` privileges.
    42  
    43  2. Make sure your existing yum packages are up-to-date.
    44  
    45          $ sudo yum update
    46  
    47  3. Add the yum repo yourself.
    48  
    49      For version 6:
    50  
    51          $ sudo tee /etc/yum.repos.d/docker.repo <<-EOF
    52          [dockerrepo]
    53          name=Docker Repository
    54          baseurl=https://yum.dockerproject.org/repo/main/oraclelinux/6
    55          enabled=1
    56          gpgcheck=1
    57          gpgkey=https://yum.dockerproject.org/gpg
    58          EOF
    59  
    60      For version 7:
    61  
    62          $ cat >/etc/yum.repos.d/docker.repo <<-EOF
    63          [dockerrepo]
    64          name=Docker Repository
    65          baseurl=https://yum.dockerproject.org/repo/main/oraclelinux/7
    66          enabled=1
    67          gpgcheck=1
    68          gpgkey=https://yum.dockerproject.org/gpg
    69          EOF
    70  
    71  4. Install the Docker package.
    72  
    73          $ sudo yum install docker-engine
    74  
    75  5. Start the Docker daemon.
    76  
    77       On Oracle Linux 6:
    78  
    79          $ sudo service docker start
    80  
    81       On Oracle Linux 7:
    82  
    83          $ sudo systemctl start docker.service
    84  
    85  6. Verify `docker` is installed correctly by running a test image in a container.
    86  
    87          $ sudo docker run hello-world
    88  
    89  ## Optional configurations
    90  
    91  This section contains optional procedures for configuring your Oracle Linux to work
    92  better with Docker.
    93  
    94  * [Create a docker group](#create-a-docker-group)
    95  * [Configure Docker to start on boot](#configure-docker-to-start-on-boot)
    96  * [Use the btrfs storage engine](#use-the-btrfs-storage-engine)
    97  
    98  ### Create a Docker group		
    99  
   100  The `docker` daemon binds to a Unix socket instead of a TCP port. By default
   101  that Unix socket is owned by the user `root` and other users can access it with
   102  `sudo`. For this reason, `docker` daemon always runs as the `root` user.
   103  
   104  To avoid having to use `sudo` when you use the `docker` command, create a Unix
   105  group called `docker` and add users to it. When the `docker` daemon starts, it
   106  makes the ownership of the Unix socket read/writable by the `docker` group.
   107  
   108  >**Warning**: The `docker` group is equivalent to the `root` user; For details
   109  >on how this impacts security in your system, see [*Docker Daemon Attack
   110  >Surface*](../../security/security.md#docker-daemon-attack-surface) for details.
   111  
   112  To create the `docker` group and add your user:
   113  
   114  1. Log into Oracle Linux as a user with `sudo` privileges.
   115  
   116  2. Create the `docker` group and add your user.
   117  
   118          sudo usermod -aG docker username
   119  
   120  3. Log out and log back in.
   121  
   122      This ensures your user is running with the correct permissions.
   123  
   124  4. Verify your work by running `docker` without `sudo`.
   125  
   126          $ docker run hello-world
   127  
   128  	If this fails with a message similar to this:
   129  
   130  		Cannot connect to the Docker daemon. Is 'docker daemon' running on this host?
   131  
   132  	Check that the `DOCKER_HOST` environment variable is not set for your shell.
   133  	If it is, unset it.
   134  
   135  ### Configure Docker to start on boot
   136  
   137  You can configure the  Docker daemon to start automatically at boot.
   138  
   139  On Oracle Linux 6:
   140  
   141  ```
   142  $ sudo chkconfig docker on
   143  ```
   144  
   145  On Oracle Linux 7:
   146  
   147  ```
   148  $ sudo systemctl enable docker.service
   149  ```
   150  
   151  If you need to add an HTTP Proxy, set a different directory or partition for the
   152  Docker runtime files, or make other customizations, read our systemd article to
   153  learn how to [customize your systemd Docker daemon options](../../admin/systemd.md).
   154  
   155  ### Use the btrfs storage engine
   156  
   157  Docker on Oracle Linux 6 and 7 supports the use of the btrfs storage engine.
   158  Before enabling btrfs support, ensure that `/var/lib/docker` is stored on a
   159  btrfs-based filesystem. Review [Chapter
   160  5](http://docs.oracle.com/cd/E37670_01/E37355/html/ol_btrfs.html) of the [Oracle
   161  Linux Administrator's Solution
   162  Guide](http://docs.oracle.com/cd/E37670_01/E37355/html/index.html) for details
   163  on how to create and mount btrfs filesystems.
   164  
   165  To enable btrfs support on Oracle Linux:
   166  
   167  1. Ensure that `/var/lib/docker` is on a btrfs filesystem.
   168  
   169  2. Edit `/etc/sysconfig/docker` and add `-s btrfs` to the `OTHER_ARGS` field.
   170  
   171  3. Restart the Docker daemon:
   172  
   173  ## Uninstallation
   174  
   175  To uninstall the Docker package:
   176  
   177      $ sudo yum -y remove docker-engine
   178  
   179  The above command will not remove images, containers, volumes, or user created
   180  configuration files on your host. If you wish to delete all images, containers,
   181  and volumes run the following command:
   182  
   183      $ rm -rf /var/lib/docker
   184  
   185  You must delete the user created configuration files manually.
   186  
   187  ## Known issues
   188  
   189  ### Docker unmounts btrfs filesystem on shutdown
   190  If you're running Docker using the btrfs storage engine and you stop the Docker
   191  service, it will unmount the btrfs filesystem during the shutdown process. You
   192  should ensure the filesystem is mounted properly prior to restarting the Docker
   193  service.
   194  
   195  On Oracle Linux 7, you can use a `systemd.mount` definition and modify the
   196  Docker `systemd.service` to depend on the btrfs mount defined in systemd.
   197  
   198  ### SElinux support on Oracle Linux 7
   199  SElinux must be set to `Permissive` or `Disabled` in `/etc/sysconfig/selinux` to
   200  use the btrfs storage engine on Oracle Linux 7.
   201  
   202  ## Further issues?
   203  
   204  If you have a current Basic or Premier Support Subscription for Oracle Linux,
   205  you can report any issues you have with the installation of Docker via a Service
   206  Request at [My Oracle Support](http://support.oracle.com).
   207  
   208  If you do not have an Oracle Linux Support Subscription, you can use the [Oracle
   209  Linux
   210  Forum](https://community.oracle.com/community/server_%26_storage_systems/linux/oracle_linux) for community-based support.