Setting up basic service with docker compose

Hi there,

Im trying to create a service using the the "Local - Docker Compose" tutorial that has ziti private blue/ red etc. I have the network set up on an ubuntu virtual machine on my laptop using docker and I can display the webpage as per the tutorial using localhost. When I set up the service in the ZAC and try connecting from my ubuntu vm which I have set up an identity for I get the message:

"Failed to connect to http.ziti port 80 after 133923 ms: Couldn't connect to server"

I have not changed any of the defaults in my .env file:

OpenZiti Variables

ZITI_IMAGE=openziti/quickstart
ZITI_VERSION=latest

the user and password to use

Leave password blank to have a unique value generated or set the password explicitly

ZITI_USER=admin
ZITI_PWD=myziti

ZITI_INTERFACE=0.0.0.0

controller name, address/port information

ZITI_CTRL_NAME=ziti-controller
ZITI_CTRL_EDGE_ADVERTISED_ADDRESS=ziti-edge-controller
ZITI_CTRL_ADVERTISED_ADDRESS=ziti-controller
#ZITI_CTRL_EDGE_IP_OVERRIDE=10.10.10.10
#ZITI_CTRL_EDGE_ADVERTISED_PORT=8441
#ZITI_CTRL_ADVERTISED_PORT=8440

The duration of the enrollment period (in minutes), default if not set. shown - 7days

ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION=10080
ZITI_ROUTER_ENROLLMENT_DURATION=10080

router address/port information

#ZITI_ROUTER_NAME=ziti-edge-router
#ZITI_ROUTER_ADVERTISED_ADDRESS=ziti-edge-router
#ZITI_ROUTER_PORT=8442
#ZITI_ROUTER_IP_OVERRIDE=10.10.10.10
#ZITI_ROUTER_LISTENER_BIND_PORT=8444
#ZITI_ROUTER_ROLES=public
~

Do I have to change any of the above to get this to work locally on an ubuntu VM or is there something else Im missing setting this up ?

Thanks,

Col

I'm not sure what went wrong there, but here's another compose example you could try: ziti/quickstart/docker/all-in-one/compose.yml at allinone-controller-image · openziti/ziti · GitHub

That's in a branch and the only difference from ziti/quickstart/docker/all-in-one/compose.yml at main · openziti/ziti · GitHub is that is uses the controller container image which has the web console built-in.

It's accompanied by this README: ziti/quickstart/docker/all-in-one/README.md at main · openziti/ziti · GitHub

allinone-controller

Link to Asciicast

Did you follow the ziti cli commands or did you translate them through to ZAC equivalent commands? The doc has you create a host v1 that points to port 80:

ziti edge create config http.host.v1 host.v1 '{"protocol":"tcp", "address":"'"${http_server}"'", "port":80}'

but in the docker compose realm that's incorrect. it should be 8000 assuming you started the hello world using:

docker run -d --rm --name web-test -p 80:8000 openziti/hello-world

OR - I would stop that web-test and use:

docker run -d --rm --name web-test -p 80:80 openziti/hello-world

Then your host.v1 config will be accurate, or you can update that host.v1 to use port 8000, either way should work. I'll go put a PR in that adds words to this effect so that it doesn't confuse people again... Sorry about that, try it out and see if that solves the issue for you?

Yeah, that's the issue I think... I just ran through the docker compose bring up and then followed the instructions at Your First Service | OpenZiti. I had set my http_server to web.test.blue and my http_server_id to ziti-private-blue.

I then had to update my host.v1 config with port 8000:

ziti edge update config http.host.v1 -d '{"protocol":"tcp", "address":"'"${http_server}"'", "port":8000}'

I enrolled using the Ziti Desktop Edge for Windows and then curl'ed to http.ziti:

Thank you both for the help - I adjusted the port and that has solved my issue