I have setup 3 vagrant ubuntu (bento/ubuntu-16.04) nodes within the same private network.
On both nodes I have installed docker.
I have tested connectivity on all ports for swarm mode and the nodes can communicate with each other (tcp/udp).
Now I made one node the manager node. I have been following the following tutorial:
When setting up a registry service like:
docker service create --name registry --publish 5000:5000 registry:2
and doing:
docker service ls
I have the following output:
ID NAME MODE REPLICAS IMAGE PORTS
z2vbuuihk0wz registry replicated 1/1 registry:2 *:5000->5000/tcp
As you can see the registry is published to all ip’s on port 5000.
Now when I do:
curl http://localhost:5000/v2/
It won’t show me the curly braces as in the example. It just hangs.
However when I do:
curl http://127.0.0.1:5000/v2/
It does show me the curly braces.
When I ping localhost it resolves to 127.0.0.1.
My vagrantfile is just the standard one and I just added:
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
end
The following:
docker service inspect --pretty registry
gives:
ID: z2vbuuihk0wzby13ir23f98eo
Name: registry
Service Mode: Replicated
Replicas: 1
Placement:
UpdateConfig:
Parallelism: 1
On failure: pause
Monitoring Period: 5s
Max failure ratio: 0
Update order: stop-first
RollbackConfig:
Parallelism: 1
On failure: pause
Monitoring Period: 5s
Max failure ratio: 0
Rollback order: stop-first
ContainerSpec:
Image: registry:2@sha256:f5552e60ffd56fecbe2f04b61a3089a9cd755bd9352b6b5ab22cf2208af6a3a8
Resources:
Endpoint Mode: vip
Ports:
PublishedPort = 5000
Protocol = tcp
TargetPort = 5000
PublishMode = ingress
When doing:
curl http://{node_ip}:5000/v2/
it also gives me the curly braces. My question is. Does anyone know why I don’t get the curly braces when using localhost.