How to use this box with Vagrant:

Vagrant.configure("2") do |config|
  config.vm.box = "ailispaw/docker-root"
  config.vm.box_version = "1.3.10"
end
vagrant init ailispaw/docker-root \
  --box-version 1.3.10
vagrant up

This version was created about 6 years ago.

DockerRoot Vagrant Box

DockerRoot (formerly RancherOS Lite) is a lightweight Linux distribution made with Buildroot especially to run a Docker daemon as PID 1.

Features

  • Based on Buildroot 2016.02 with Linux kernel v4.4.8 and GLIBC.
  • Runs a Docker daemon as PID 1
  • Docker v1.9.1
  • Support NFS synced folder
  • Support VirtualBox Shared Folder
  • Support Docker provisioner
  • Disable TLS of Docker for simplicity
  • Expose and forward the official IANA registered Docker port 2375
  • dumb-init binary is built-in /usr/bin
  • pkg command is built-in. You can install individual packages from Buildroot.
  • Enable to switch between Docker versions
  • 40 GB persistent disk
  • 13 MB

Cf.)

Vagrant up

$ vagrant box add ailispaw/docker-root
$ vagrant init -m ailispaw/docker-root
$ vagrant up

Vagrantfile

# A dummy plugin for DockerRoot to set hostname and network correctly at the very first `vagrant up`
module VagrantPlugins
  module GuestLinux
    class Plugin < Vagrant.plugin("2")
      guest_capability("linux", "change_host_name") { Cap::ChangeHostName }
      guest_capability("linux", "configure_networks") { Cap::ConfigureNetworks }
    end
  end
end

Vagrant.configure(2) do |config|
  config.vm.define "docker-root"

  config.vm.box = "ailispaw/docker-root"
  config.vm.box_version = ">= 1.3.9"

  config.vm.synced_folder ".", "/vagrant"

  # for NFS synced folder
  # config.vm.network "private_network", ip: "192.168.33.10"
  # config.vm.synced_folder ".", "/vagrant", type: "nfs",
  #   mount_options: ["nolock", "vers=3", "udp", "noatime", "actimeo=1"]

  # for RSync synced folder
  # config.vm.synced_folder ".", "/vagrant", type: "rsync",
  #   rsync__args: ["--verbose", "--archive", "--delete", "--copy-links"]

  config.vm.provision :docker do |d|
    d.pull_images "busybox"
    d.run "simple-echo",
      image: "busybox",
      args: "-p 8080:8080 -v /usr/bin/dumb-init:/dumb-init:ro --entrypoint=/dumb-init",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end

  config.vm.network :forwarded_port, guest: 8080, host: 8080
end
1 provider for this version.
  • virtualbox Externally hosted (github.com)