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