News, tips, partners, and perspectives for the Oracle Linux operating system and upstream Linux kernel work

From Zero to Docker Sandbox in 2 Minutes

OK, not completely zero, but pretty close! If you have Oracle VM VirtualBox and Vagrant installed and would like to take Docker for a spin on Oracle Linux, you should try this.

Our most recent Oracle Linux 7 Update 4 Vagrant box makes a good starting point to set up and configure Docker. It includes:

  • Unbreakable Enterprise Kernel 4 Update 5 with support for Docker and Btrfs
  • A spare virtual disk (/dev/sdb) to create a Btrfs partition for management of Docker images and containers
  • Yum configured to access the Addons repo on Oracle Linux yum server

The Vagrantfile below got me from zero to running Oracle Linux with Docker configured on my MacBook in 2 minutes and change. To use this Vagrantfile:

  1. If you haven't already, install Oracle VM VirtualBox and Vagrant.
  2. Create a working directory and make it your current location
  3. Copy the contents of the Vagrantfile below and create a file called Vagrantfile
  4. Run Vagrant commands to provision and start the box and ssh in to it

I ran the following with VirtualBox 5.1.22 and Vagrant 2.0.0:

$ mkdir sandbox
$ cd sandbox
$ pbpaste > Vagrantfie
$ vagrant up
$ vagrant ssh

You are now ready to run Docker commands. If you are new to Docker and already use VirtualBox and Vagrant, this is a quick way to explore what Docker is all about. I also recommend this article: Getting Started with Docker on Oracle Linux and Chapter 4 from the Oracle Linux 7 documentation: Working with Containers and Images.

As always, give us your feedback and questions in the Oracle Linux Community on OTN.


Join the discussion

Comments ( 3 )
  • James Tuesday, September 12, 2017
    This worked perfect. I ran the example on Windows 10 and already had the same virtual box version as in the example installed. I had to install vagrant. Once completed followed the example and up and running in like ~5 minutes.
  • Mike Sunday, November 4, 2018
    Box would not install using default settings. But installed OK when I used the 0175 box/link.
  • Sergio Monday, November 5, 2018
    @Mike since this blog post, we've formalized this sort of setup in our Vagrant repo on GitHub: https://github.com/oracle/vagrant-boxes
    I'll update this blog post accordingly.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha