Set up Docker on Oracle Linux (7.x) with Vagrant

Purpose

I want to start Oracle Linux (7.x) with Vagrant, and then install and start Docker. (Host is Windows 10 Home Edition. Vagrant and VirtualBox are already set up)

Find out information about Vagrant Box

Check at the following site. Check the URL of the Oracle Linux Vagrant box.

Oracle Linux Vagrant boxes https://yum.oracle.com/boxes/

This time it is assumed to be Oracle Linux 7.x https://oracle.github.io/vagrant-projects/boxes/oraclelinux/7.json To use.

Find out Docker installation information on Oracle Linux

In Oracle Linux Docker, there is a translation in Docker-docs-ja, but it is 1.13.RC, and the setting of Yum repository is different now, so this part is not helpful. https://docs.docker.jp/engine/installation/linux/oracle.html

If you look at the installation manual in the Docker manual, you can see that Oracle Linux is missing from the Linux distribution chapter. https://docs.docker.com/engine/install/

The following blog mentions the setting of Oracle yum repository of Oracle Linux.

A Simple Guide to docker installation on Oracle Linux 7.5 [Updated Oct 2019] https://blogs.oracle.com/blogbypuneeth/a-simple-guide-to-docker-installation-on-oracle-linux-75

As of October 2020, "ol7_latest" and "ol7_addons" were enabled by default as the settings of the yum repository of Oracle Linux acquired in the above Box, and no additional setting changes were necessary. There was no problem even if "ol7_UEKR4" in the above blog was left disabled.

Vagrantfile

Vagrantfile example

Vagrant.configure("2") do |config|
  config.vm.box = "oraclelinux/7"
  config.vm.box_url = "https://oracle.github.io/vagrant-projects/boxes/oraclelinux/7.json"
  config.vm.network :forwarded_port, id: "ssh", guest: 22, host: 2210
  config.vm.provider "virtualbox" do |vb|
   vb.memory = "8196"
  end
  config.vm.provision "shell", inline: <<-SHELL
i=1; while [ $i -le 10 ]; do echo $i;yum -y --disablerepo=* --enablerepo=ol7_addons,ol7_latest  install docker-engine;if [ $? -eq 0 ];then break;fi;i=$(expr $i + 1);done
systemctl start docker.service
systemctl enable docker.service
SHELL
end

A little explanation.

Start Vagrant

> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'oraclelinux/7'...
<Omission>

> vagrant ssh

Welcome to Oracle Linux Server release 7.8 (GNU/Linux 4.14.35-2025.400.8.el7uek.x86_64)

The Oracle Linux End-User License Agreement can be viewed here:

  * /usr/share/eula/eula.en_US

For additional packages, updates, documentation and community help, see:

  * https://yum.oracle.com/

[vagrant@localhost ~]$ sudo su -
[root@localhost ~]# docker version
Client: Docker Engine - Community
 Version:           19.03.11-ol
 API version:       1.40
 Go version:        go1.14.7
 Git commit:        78418d7
 Built:             Tue Aug 18 22:46:21 2020
 OS/Arch:           linux/amd64
 Experimental:      false
<The following is omitted>

Recommended Posts

Set up Docker on Oracle Linux (7.x) with Vagrant
Set up golang with goenv on GNU / Linux
Set up a Samba server with Docker
X86 assembler on Linux (linkage with C)
Set up an Objective-C 2.0 development environment on Linux
EC2 provisioning with Vagrant + Jupyter (IPython Notebook) on Docker
[Part 1] Let's set up a Minecraft server on Linux
Launch Django on a Docker container with docker-compose up
[Vagrant] Set up a simple API server with python
Set up Python 3.4 on Ubuntu
Set up Polyglot on Windows
Test Python with Miniconda on OS X and Linux with travis-ci
Get the host name of the host PC with Docker on Linux
Setting up OpenSSH on Arch Linux
Set up social login with Django
Set up pygit2 with static link
Install oracle java8 on amazon linux2
Completion of docker command on Linux
Set up Python environment on CentOS
[Linux] Docker environment construction on Redhat
Create a Docker container image with JRE8 / JDK8 on Amazon Linux
Run cron on Amazon Linux (set on Linux)
Set up reverse proxy to https server with CentOS Linux 8 + Apache mod_ssl
[C] [python] Read with AquesTalk on Linux
Dockerfile: Install Docker on your Linux server
Install Mecab on Linux (CentOS) with brew
[Linux] Build a jenkins environment with Docker
Run Keycloak on Amazon Linux 2 without Docker
On Ubuntu Linux, set Tab to q
Launch Flask application with Docker on Heroku
Installing PIL with Python 3.x on macOS
Run Linux on ARM architecture with QEMU
[Linux] Build a Docker environment with Amazon Linux 2
Compiling the Linux kernel (Linux 5.x on Ubuntu 20.04)
Useful for changing permissions on Linux! How to count up to 31 with one hand.
Set up a simple HTTPS server with asyncio
Set up a local server with Go-File upload-
[Note] Install wxPython 3.x on Linux Mint (Ubuntu)
Start a process with a scheduling policy on Linux
Set up a local server with Go-File download-
Organize files on Windows with Linux commands-using WSL-
Set up python Tornado environment on raspbian jessie
Put Python 2.7.x on Mac OSX 10.15.5 with pyenv
Build Oracle Database 19c on Oracle Linux 8.3 (DB Build Part 2)
Set up a Python development environment on Marvericks
Back up from QNAP to Linux with rsync
Install PHP 7 series on Amazon Linux 2 with Amazon Linux Extras
Set the startup script on Linux (RasPi, Edison)
Put Scipy + Matplotlib in Ubuntu on Vagrant and display the graph with X11 Forwarding