Skip to content

Commit

Permalink
Expose both docker ports (2375 and 2376)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmakarov committed Mar 31, 2016
1 parent 88ef786 commit 56cc2f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Vagrant.configure("2") do |config|
v.customize ['storageattach', :id, '--storagectl', 'SATA', '--port', 0, '--device', 0, '--type', 'dvddrive', '--medium', File.expand_path("../boot2docker.iso", __FILE__)]
end

# Expose the Docker port (no TLS)
# Expose the Docker ports
config.vm.network "forwarded_port", guest: 2375, host: 2375, host_ip: "127.0.0.1", auto_correct: true, id: "docker"
config.vm.network "forwarded_port", guest: 2376, host: 2376, host_ip: "127.0.0.1", auto_correct: true, id: "docker-tls"
end
6 changes: 3 additions & 3 deletions scripts/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ sudo ln -s /mnt/sda1/cygdrive /cygdrive
SCRIPT
sudo chmod +x /var/lib/boot2docker/bootsync.sh

# Disable DOCKER_TLS
sudo sed -i 's/DOCKER_TLS=.*/DOCKER_TLS=no/' /var/lib/boot2docker/profile
sudo sed -i 's/2376/2375/' /var/lib/boot2docker/profile
# Disable DOCKER_TLS and make sure docker listens on 2375 and 2376 ports
sudo sed -i '/DOCKER_TLS=/c DOCKER_TLS=no' /var/lib/boot2docker/profile
sudo sed -i '/DOCKER_HOST=/c DOCKER_HOST="-H tcp://0.0.0.0:2375 -H tcp://0.0.0.0:2376"' /var/lib/boot2docker/profile

# Append Docker IP and DNS configuration to EXTRA_ARGS
sudo sed -i "/EXTRA_ARGS='/a --dns 172.17.42.1 --dns 8.8.8.8" /var/lib/boot2docker/profile
Expand Down

0 comments on commit 56cc2f1

Please sign in to comment.