How to use this box with Vagrant:

Vagrant.configure("2") do |config|
  config.vm.box = "parallels/boot2docker"
end
vagrant init parallels/boot2docker
vagrant up

This version was created about 9 years ago.

boot2docker with Docker v1.6.0

  • Based on boot2docker with Docker v1.6.0
  • Support NFS synced folder
  • Support Docker provisioner
  • Expose the official IANA registered Docker port 2375
  • Added nsenter and docker-enter (docker-attach)
  • Removed TLS support from the original boot2docker
  • Added e2fsprogs for resize2fs

Cf.) https://github.com/Parallels/boot2docker-vagrant-box

Sample Vagrantfile

Vagrant.require_version ">= 1.6.3"

Vagrant.configure("2") do |config|
  config.vm.define "boot2docker"

  config.vm.box = "parallels/boot2docker"

  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Fix busybox/udhcpc issue
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      if ! grep -qs ^nameserver /etc/resolv.conf; then
        sudo /sbin/udhcpc
      fi
      cat /etc/resolv.conf
    EOT
  end

  # Adjust datetime after suspend and resume
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
      date
    EOT
  end

  config.vm.provision :docker do |d|
    d.pull_images "yungsang/busybox"
    d.run "simple-echo",
      image: "yungsang/busybox",
      args: "-p 8080:8080",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end
end

Run it:

$ vagrant plugin install vagrant-parallels
$ vagrant init parallels/boot2docker
$ vagrant up --provider parallels
$ export DOCKER_HOST_IP=$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
$ export DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"
$ docker version
$ docker images
$ docker ps
$ nc ${DOCKER_HOST_IP} 8080
hello world!

Check it:

$ docker ps -l
CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                    NAMES
f3f38ced897a        yungsang/busybox:latest   nc -p 8080 -l -l -e    27 minutes ago      Up 9 minutes        0.0.0.0:8080->8080/tcp   simple-echo
$ docker exec $(docker ps -l -q) ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   21 root     ps
$ docker exec -it $(docker ps -l -q) sh
/ # ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   46 root     sh
   55 root     ps
/ # exit
$ 
1 provider for this version.
  • parallels
    unknown Externally hosted (github.com)

This version was created over 9 years ago.

boot2docker with Docker v1.5.0

  • Based on boot2docker with Docker v1.5.0
  • Support NFS synced folder
  • Support Docker provisioner
  • Expose the official IANA registered Docker port 2375
  • Added nsenter and docker-enter (docker-attach)
  • Removeed TLS support from the original boot2docker
  • Added e2fsprogs for resize2fs

Cf.) https://github.com/Parallels/boot2docker-vagrant-box

Sample Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.6.3"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "boot2docker"

  config.vm.box = "parallels/boot2docker"

  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Fix busybox/udhcpc issue
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      if ! grep -qs ^nameserver /etc/resolv.conf; then
        sudo /sbin/udhcpc
      fi
      cat /etc/resolv.conf
    EOT
  end

  # Adjust datetime after suspend and resume
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
      date
    EOT
  end

  config.vm.provision :docker do |d|
    d.pull_images "yungsang/busybox"
    d.run "simple-echo",
      image: "yungsang/busybox",
      args: "-p 8080:8080",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end
end

Run it:

$ vagrant plugin install vagrant-parallels
$ vagrant init parallels/boot2docker
$ vagrant up --provider parallels
$ export DOCKER_HOST_IP=$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
$ export DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"
$ docker version
$ docker images
$ docker ps
$ nc ${DOCKER_HOST_IP} 8080
hello world!

Check it:

$ docker ps -l
CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                    NAMES
f3f38ced897a        yungsang/busybox:latest   nc -p 8080 -l -l -e    27 minutes ago      Up 9 minutes        0.0.0.0:8080->8080/tcp   simple-echo
$ docker exec $(docker ps -l -q) ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   21 root     ps
$ docker exec -it $(docker ps -l -q) sh
/ # ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   46 root     sh
   55 root     ps
/ # exit
$ 

Cf.) If you run SSHD in your Docker containers, you're doing it wrong!

1 provider for this version.
  • parallels
    unknown Externally hosted (github.com)

This version was created over 9 years ago.

boot2docker with Docker v1.4.1

  • Based on boot2docker with Docker v1.4.1
  • Support NFS synced folder
  • Support Docker provisioner
  • Expose the official IANA registered Docker port 2375
  • Add nsenter and docker-enter (docker-attach)
  • Remove TLS support from the original boot2docker
  • Add e2fsprogs for resize2fs

Cf.) https://github.com/Parallels/boot2docker-vagrant-box

Sample Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.6.3"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "boot2docker"

  config.vm.box = "parallels/boot2docker"

  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Fix busybox/udhcpc issue
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      if ! grep -qs ^nameserver /etc/resolv.conf; then
        sudo /sbin/udhcpc
      fi
      cat /etc/resolv.conf
    EOT
  end

  # Adjust datetime after suspend and resume
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
      date
    EOT
  end

  config.vm.provision :docker do |d|
    d.pull_images "yungsang/busybox"
    d.run "simple-echo",
      image: "yungsang/busybox",
      args: "-p 8080:8080",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end
end
$ vagrant plugin install vagrant-parallels
$ vagrant init parallels/boot2docker
$ vagrant up --provider parallels
$ export DOCKER_HOST_IP=$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
$ export DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"
$ docker version
$ docker images
$ docker ps
$ nc ${DOCKER_HOST_IP} 8080
hello world!
$ docker ps -l
CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                    NAMES
f3f38ced897a        yungsang/busybox:latest   nc -p 8080 -l -l -e    27 minutes ago      Up 9 minutes        0.0.0.0:8080->8080/tcp   simple-echo
$ docker exec $(docker ps -l -q) ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   21 root     ps
$ docker exec -it $(docker ps -l -q) sh
/ # ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   46 root     sh
   55 root     ps
/ # exit
$ 

Cf.) If you run SSHD in your Docker containers, you're doing it wrong!

1 provider for this version.
  • parallels
    unknown Externally hosted (github.com)

This version was created over 9 years ago.

boot2docker with Docker v1.3.3

  • Based on boot2docker with Docker v1.3.3
  • Support NFS synced folder
  • Support Docker provisioner
  • Expose the official IANA registered Docker port 2375
  • Add nsenter and docker-enter (docker-attach)
  • Remove TLS support from the original boot2docker
  • Add e2fsprogs for resize2fs

Cf.) https://github.com/Parallels/boot2docker-vagrant-box

Sample Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.6.3"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "boot2docker"

  config.vm.box = "parallels/boot2docker"

  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Fix busybox/udhcpc issue
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      if ! grep -qs ^nameserver /etc/resolv.conf; then
        sudo /sbin/udhcpc
      fi
      cat /etc/resolv.conf
    EOT
  end

  # Adjust datetime after suspend and resume
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
      date
    EOT
  end

  config.vm.provision :docker do |d|
    d.pull_images "yungsang/busybox"
    d.run "simple-echo",
      image: "yungsang/busybox",
      args: "-p 8080:8080",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end
end
$ vagrant plugin install vagrant-parallels
$ vagrant init parallels/boot2docker
$ vagrant up --provider parallels
$ export DOCKER_HOST_IP=$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
$ export DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"
$ docker version
$ docker images
$ docker ps
$ nc ${DOCKER_HOST_IP} 8080
hello world!
$ docker ps -l
CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                    NAMES
f3f38ced897a        yungsang/busybox:latest   nc -p 8080 -l -l -e    27 minutes ago      Up 9 minutes        0.0.0.0:8080->8080/tcp   simple-echo
$ docker exec $(docker ps -l -q) ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   21 root     ps
$ docker exec -it $(docker ps -l -q) sh
/ # ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   46 root     sh
   55 root     ps
/ # exit
$ 

Cf.) If you run SSHD in your Docker containers, you're doing it wrong!

1 provider for this version.
  • parallels
    unknown Externally hosted (github.com)

This version was created over 9 years ago.

boot2docker with Docker v1.3.3

  • Based on boot2docker with Docker v1.3.3
  • Support NFS synced folder
  • Support Docker provisioner
  • Expose the official IANA registered Docker port 2375
  • Add nsenter and docker-enter (docker-attach)
  • Remove TLS support from the original boot2docker
  • Add e2fsprogs for resize2fs

Cf.) https://github.com/Parallels/boot2docker-vagrant-box

Sample Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.6.3"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "boot2docker"

  config.vm.box = "parallels/boot2docker"

  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Fix busybox/udhcpc issue
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      if ! grep -qs ^nameserver /etc/resolv.conf; then
        sudo /sbin/udhcpc
      fi
      cat /etc/resolv.conf
    EOT
  end

  # Adjust datetime after suspend and resume
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
      date
    EOT
  end

  config.vm.provision :docker do |d|
    d.pull_images "yungsang/busybox"
    d.run "simple-echo",
      image: "yungsang/busybox",
      args: "-p 8080:8080",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end
end
$ vagrant plugin install vagrant-parallels
$ vagrant init parallels/boot2docker
$ vagrant up --provider parallels
$ export DOCKER_HOST_IP=$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
$ export DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"
$ docker version
$ docker images
$ docker ps
$ nc ${DOCKER_HOST_IP} 8080
hello world!
$ docker ps -l
CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                    NAMES
f3f38ced897a        yungsang/busybox:latest   nc -p 8080 -l -l -e    27 minutes ago      Up 9 minutes        0.0.0.0:8080->8080/tcp   simple-echo
$ docker exec $(docker ps -l -q) ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   21 root     ps
$ docker exec -it $(docker ps -l -q) sh
/ # ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   46 root     sh
   55 root     ps
/ # exit
$ 

Cf.) If you run SSHD in your Docker containers, you're doing it wrong!

1 provider for this version.
  • parallels
    unknown Externally hosted (github.com)

This version was created over 9 years ago.

boot2docker with Docker v1.3.2

  • Based on boot2docker with Docker v1.3.2
  • Support NFS synced folder
  • Support Docker provisioner
  • Expose the official IANA registered Docker port 2375
  • Add nsenter and docker-enter (docker-attach)
  • Remove TLS support from the original boot2docker

Cf.) https://github.com/Parallels/boot2docker-vagrant-box

Sample Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.6.3"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "boot2docker"

  config.vm.box = "parallels/boot2docker"

  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Fix busybox/udhcpc issue
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      if ! grep -qs ^nameserver /etc/resolv.conf; then
        sudo /sbin/udhcpc
      fi
      cat /etc/resolv.conf
    EOT
  end

  # Adjust datetime after suspend and resume
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
      date
    EOT
  end

  config.vm.provision :docker do |d|
    d.pull_images "yungsang/busybox"
    d.run "simple-echo",
      image: "yungsang/busybox",
      args: "-p 8080:8080",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end
end
$ vagrant plugin install vagrant-parallels
$ vagrant init parallels/boot2docker
$ vagrant up --provider parallels
$ export DOCKER_HOST_IP=$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
$ export DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"
$ docker version
$ docker images
$ docker ps
$ nc ${DOCKER_HOST_IP} 8080
hello world!
$ docker ps -l
CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                    NAMES
f3f38ced897a        yungsang/busybox:latest   nc -p 8080 -l -l -e    27 minutes ago      Up 9 minutes        0.0.0.0:8080->8080/tcp   simple-echo
$ docker exec $(docker ps -l -q) ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   21 root     ps
$ docker exec -it $(docker ps -l -q) sh
/ # ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   46 root     sh
   55 root     ps
/ # exit
$ 

Cf.) If you run SSHD in your Docker containers, you're doing it wrong!

1 provider for this version.
  • parallels
    unknown Externally hosted (github.com)

This version was created over 9 years ago.

boot2docker with Docker v1.3.1

  • Based on boot2docker with Docker v1.3.1
  • Support NFS synced folder
  • Support Docker provisioner
  • Expose the official IANA registered Docker port 2375
  • Add nsenter and docker-enter (docker-attach)
  • Remove TLS support from the original boot2docker

Cf.) https://github.com/Parallels/boot2docker-vagrant-box

Sample Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.6.3"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "boot2docker"

  config.vm.box = "parallels/boot2docker"

  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Fix busybox/udhcpc issue
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      if ! grep -qs ^nameserver /etc/resolv.conf; then
        sudo /sbin/udhcpc
      fi
      cat /etc/resolv.conf
    EOT
  end

  # Adjust datetime after suspend and resume
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
      date
    EOT
  end

  config.vm.provision :docker do |d|
    d.pull_images "yungsang/busybox"
    d.run "simple-echo",
      image: "yungsang/busybox",
      args: "-p 8080:8080",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end
end
$ vagrant plugin install vagrant-parallels
$ vagrant init parallels/boot2docker
$ vagrant up --provider parallels
$ export DOCKER_HOST_IP=$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
$ export DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"
$ docker version
$ docker images
$ docker ps
$ nc ${DOCKER_HOST_IP} 8080
hello world!
$ docker ps -l
CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                    NAMES
f3f38ced897a        yungsang/busybox:latest   nc -p 8080 -l -l -e    27 minutes ago      Up 9 minutes        0.0.0.0:8080->8080/tcp   simple-echo
$ docker exec $(docker ps -l -q) ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   21 root     ps
$ docker exec -it $(docker ps -l -q) sh
/ # ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   46 root     sh
   55 root     ps
/ # exit
$ 

Cf.) If you run SSHD in your Docker containers, you're doing it wrong!

1 provider for this version.
  • parallels
    unknown Externally hosted (github.com)

This version was created over 9 years ago.

boot2docker with Docker v1.3.1

  • Based on boot2docker with Docker v1.3.1
  • Support NFS synced folder
  • Support Docker provisioner
  • Expose the official IANA registered Docker port 2375
  • Add nsenter and docker-enter (docker-attach)
  • Remove TLS support from the original boot2docker

Cf.) https://github.com/Parallels/boot2docker-vagrant-box

Sample Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.6.3"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "boot2docker"

  config.vm.box = "parallels/boot2docker"

  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Fix busybox/udhcpc issue
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      if ! grep -qs ^nameserver /etc/resolv.conf; then
        sudo /sbin/udhcpc
      fi
      cat /etc/resolv.conf
    EOT
  end

  # Adjust datetime after suspend and resume
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
      date
    EOT
  end

  config.vm.provision :docker do |d|
    d.pull_images "yungsang/busybox"
    d.run "simple-echo",
      image: "yungsang/busybox",
      args: "-p 8080:8080",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end
end
$ vagrant plugin install vagrant-parallels
$ vagrant init parallels/boot2docker
$ vagrant up --provider parallels
$ export DOCKER_HOST_IP=$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
$ export DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"
$ docker version
$ docker images
$ docker ps
$ nc ${DOCKER_HOST_IP} 8080
hello world!
$ docker ps -l
CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                    NAMES
f3f38ced897a        yungsang/busybox:latest   nc -p 8080 -l -l -e    27 minutes ago      Up 9 minutes        0.0.0.0:8080->8080/tcp   simple-echo
$ docker exec $(docker ps -l -q) ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   21 root     ps
$ docker exec -it $(docker ps -l -q) sh
/ # ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   46 root     sh
   55 root     ps
/ # exit
$ 

Cf.) If you run SSHD in your Docker containers, you're doing it wrong!

1 provider for this version.
  • parallels
    unknown Externally hosted (github.com)

This version was created over 9 years ago.

boot2docker with Docker v1.3.1

  • Based on boot2docker with Docker v1.3.1
  • Support NFS synced folder
  • Support Docker provisioner
  • Expose the official IANA registered Docker port 2375
  • Add nsenter and docker-enter (docker-attach)
  • Remove TLS support from the original boot2docker

Cf.) https://github.com/Parallels/boot2docker-vagrant-box

Sample Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.6.3"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "boot2docker"

  config.vm.box = "parallels/boot2docker"

  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Fix busybox/udhcpc issue
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      if ! grep -qs ^nameserver /etc/resolv.conf; then
        sudo /sbin/udhcpc
      fi
      cat /etc/resolv.conf
    EOT
  end

  # Adjust datetime after suspend and resume
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
      date
    EOT
  end

  config.vm.provision :docker do |d|
    d.pull_images "yungsang/busybox"
    d.run "simple-echo",
      image: "yungsang/busybox",
      args: "-p 8080:8080",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end
end
$ vagrant plugin install vagrant-parallels
$ vagrant init parallels/boot2docker
$ vagrant up --provider parallels
$ export DOCKER_HOST_IP=$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
$ export DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"
$ docker version
$ docker images
$ docker ps
$ nc ${DOCKER_HOST_IP} 8080
hello world!
$ docker ps -l
CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                    NAMES
f3f38ced897a        yungsang/busybox:latest   nc -p 8080 -l -l -e    27 minutes ago      Up 9 minutes        0.0.0.0:8080->8080/tcp   simple-echo
$ docker exec $(docker ps -l -q) ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   21 root     ps
$ docker exec -it $(docker ps -l -q) sh
/ # ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   46 root     sh
   55 root     ps
/ # exit
$ 

Cf.) If you run SSHD in your Docker containers, you're doing it wrong!

1 provider for this version.
  • parallels
    unknown Externally hosted (github.com)

This version was created over 9 years ago.

boot2docker with Docker v1.3.0

  • Based on boot2docker with Docker v1.3.0
  • Support NFS synced folder
  • Support Docker provisioner
  • Expose the official IANA registered Docker port 2375
  • Add nsenter and docker-enter (docker-attach)
  • Remove TLS support from the original boot2docker

Cf.) https://github.com/Parallels/boot2docker-vagrant-box

Sample Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.6.3"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "boot2docker"

  config.vm.box = "parallels/boot2docker"

  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Fix busybox/udhcpc issue
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      if ! grep -qs ^nameserver /etc/resolv.conf; then
        sudo /sbin/udhcpc
      fi
      cat /etc/resolv.conf
    EOT
  end

  # Adjust datetime after suspend and resume
  config.vm.provision :shell do |s|
    s.inline = <<-EOT
      sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
      date
    EOT
  end

  config.vm.provision :docker do |d|
    d.pull_images "yungsang/busybox"
    d.run "simple-echo",
      image: "yungsang/busybox",
      args: "-p 8080:8080",
      cmd: "nc -p 8080 -l -l -e echo hello world!"
  end
end
$ vagrant plugin install vagrant-parallels
$ vagrant init parallels/boot2docker
$ vagrant up --provider parallels
$ export DOCKER_HOST_IP=$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
$ export DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"
$ docker version
$ docker images
$ docker ps
$ nc ${DOCKER_HOST_IP} 8080
hello world!
$ docker ps -l
CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                    NAMES
f3f38ced897a        yungsang/busybox:latest   nc -p 8080 -l -l -e    27 minutes ago      Up 9 minutes        0.0.0.0:8080->8080/tcp   simple-echo
$ docker exec $(docker ps -l -q) ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   21 root     ps
$ docker exec -it $(docker ps -l -q) sh
/ # ps
PID   USER     COMMAND
    1 root     nc -p 8080 -l -l -e echo hello world!
   46 root     sh
   55 root     ps
/ # exit
$ 

Cf.) If you run SSHD in your Docker containers, you're doing it wrong!

1 provider for this version.
  • parallels
    unknown Externally hosted (github.com)
Previous Next