Oracle linux and docker

Oracle Linux

Docker is supported on Oracle Linux 6 and 7. You do not require an Oracle Linux Support subscription to install Docker on Oracle Linux.

Prerequisites

Due to current Docker limitations, Docker is only able to run only on the x86_64 architecture. Docker requires the use of the Unbreakable Enterprise Kernel Release 4 (4.1.12) or higher on Oracle Linux. This kernel supports the Docker btrfs storage engine on both Oracle Linux 6 and 7.

Install

Note: The procedure below installs binaries built by Docker. These binaries are not covered by Oracle Linux support. To ensure Oracle Linux support, please follow the installation instructions provided in the Oracle Linux documentation.

The installation instructions for Oracle Linux 6 and 7 can be found in Chapter 2 of the Docker User’s Guide

  1. Log into your machine as a user with sudo or root privileges.
  2. Make sure your existing yum packages are up-to-date.
 $ sudo tee /etc/yum.repos.d/docker.repo  
 $ cat >/etc/yum.repos.d/docker.repo  
 $ sudo yum install docker-engine 
 $ sudo service docker start 
 $ sudo systemctl start docker.service 
 $ sudo docker run hello-world 

Optional configurations

This section contains optional procedures for configuring your Oracle Linux to work better with Docker.

Create a Docker group

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.

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.

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 for details.

To create the docker group and add your user:

  1. Log into Oracle Linux as a user with sudo privileges.
  2. Create the docker group.
 $ sudo usermod -aG docker username 
 Cannot connect to the Docker daemon. Is 'docker daemon' running on this host? 

Configure Docker to start on boot

You can configure the Docker daemon to start automatically at boot.

$ sudo systemctl enable docker.service 

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.

Use the btrfs storage engine

Docker on Oracle Linux 6 and 7 supports the use of the btrfs storage engine. Before enabling btrfs support, ensure that /var/lib/docker is stored on a btrfs-based filesystem. Review Chapter 5 of the Oracle Linux Administrator’s Solution Guide for details on how to create and mount btrfs filesystems.

To enable btrfs support on Oracle Linux:

  1. Ensure that /var/lib/docker is on a btrfs filesystem.
  2. Edit /etc/sysconfig/docker and add -s btrfs to the OTHER_ARGS field.
  3. Restart the Docker daemon:

Uninstallation

To uninstall the Docker package:

$ sudo yum -y remove docker-engine 

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:

You must delete the user created configuration files manually.

Known issues

Docker unmounts btrfs filesystem on shutdown

If you’re running Docker using the btrfs storage engine and you stop the Docker service, it will unmount the btrfs filesystem during the shutdown process. You should ensure the filesystem is mounted properly prior to restarting the Docker service.

On Oracle Linux 7, you can use a systemd.mount definition and modify the Docker systemd.service to depend on the btrfs mount defined in systemd.

SElinux support on Oracle Linux 7

SElinux must be set to Permissive or Disabled in /etc/sysconfig/selinux to use the btrfs storage engine on Oracle Linux 7.

Further issues?

If you have a current Basic or Premier Support Subscription for Oracle Linux, you can report any issues you have with the installation of Docker via a Service Request at My Oracle Support.

If you do not have an Oracle Linux Support Subscription, you can use the Oracle Linux Forum for community-based support.

chat icon

Feedback? Questions? Suggestions?
Edit this page, file a ticket, or rate this page:

Источник

Читайте также:  Дамп оперативной памяти linux
Оцените статью
Adblock
detector