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