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)
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.
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.
config.vm.network :forwarded_port, id: "ssh", guest: 22, host: 2210
vb.memory = "8196"
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
> 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