X

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

From Zero to Docker Sandbox in 2 Minutes

This post was updated on June 5, 2019 to include use of Vagrant builds published on GitHub

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 6 Vagrant box makes a good starting point to set up and configure Docker. It includes:

  • Unbreakable Enterprise Kernel 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

Using a Vagrantfile from our repository of Vagrant builds on GitHub, I set up Oracle Linux with Docker configured on my MacBook in about 2 minutes and change*). To use this Vagrantfile:

  1. If you haven't already, install Oracle VM VirtualBox and Vagrant.
  2. Clone the vagrant builds repository from the Oracle organization on GitHub
  3. Change to the DockerEngine directory
  4. Run Vagrant commands to start the build, and provision your virtual machine, and connect via ssh

I ran the following with VirtualBox 6.0.8 and Vagrant 2.2.4:

$ git clone https://github.com/oracle/vagrant-boxes
$ cd vagrant-boxes/DockerEngine/
$ vagrant up
$ vagrant ssh
 

You are now ready to run Docker commands. For example, try running an Oracle Linux 6 container:

[vagrant@ol7-docker-engine-new ~]$ docker run -it oraclelinux:6-slim
Unable to find image 'oraclelinux:6-slim' locally
Trying to pull repository docker.io/library/oraclelinux ... 
6-slim: Pulling from docker.io/library/oraclelinux
a653e0382385: Pull complete 
Digest: sha256:dab3d020772dd8916892c814931df438f5afe6b06ca72d66d279bd58d52f6116
Status: Downloaded newer image for oraclelinux:6-slim
bash-4.1# cat /etc/oracle-release
Oracle Linux Server release 6.10
bash-4.1# 
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 space on the Oracle Community.

*) Your mileage may vary based on download speeds.

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.