Trying to follow the example here: Docker Private Share | Zrok
Looking at the contents of the file in the linked video, it appears that https://docs.zrok.io/zrok-private-share/compose.yml has changed and no longer works out of the box.
It looks like other people have noticed the issue (Issues using zrok with docker compose), and the problem is that there is no ZROK_TARGET
defined.
Looking at the docker compose file, I see that ZROK_TARGET
is a blanked out env variable.
Disclaimer: I have only briefly tried trouble shooting this. I came across ZROK while talking to a friend, so just wanted to have the most basic hello world example so I could poke around with ZROK. If there is a demo somewhere that works without needing additional configuration, that will work for me.
Welcome, @workmaster2n!
I did stumble upon a Docker private share issue the other day. It's probably the same one you encountered because it broke all Docker private shares because the share script erroneously tried to print the public frontend endpoint, which doesn't exist for a private share .
The fix was just accepted and will be in the next release.
You can preview this patch by pulling the Docker image I made in my account.
ZROK_CONTAINER_IMAGE="kbinghamnetfoundry/zrok:0.0.43500@sha256:96206a46243002503899ff9e7b5d827d0352ff75bf3371377eb32d9335a0a768"
Personal GitHub fork where I'm testing this: Release v0.0.43500 · qrkourier/zrok · GitHub
Here's the Docker private share compose.yml I tested it with.
services:
zrok-init:
image: busybox
# matches uid:gid of "ziggy" in zrok container image
command: chown -Rc 2171:2171 /mnt/.zrok
user: root
volumes:
- zrok_env:/mnt/.zrok
# enable zrok environment
zrok-enable:
image: ${ZROK_CONTAINER_IMAGE:-docker.io/openziti/zrok}
depends_on:
zrok-init:
condition: service_completed_successfully
entrypoint: zrok-enable.bash
volumes:
- zrok_env:/mnt
environment:
HOME: /mnt
ZROK_ENABLE_TOKEN:
ZROK_API_ENDPOINT:
ZROK_ENVIRONMENT_NAME: docker-kentest-private
zrok-share:
image: ${ZROK_CONTAINER_IMAGE:-docker.io/openziti/zrok}
restart: unless-stopped
entrypoint: zrok-share.bash
depends_on:
zrok-enable:
condition: service_completed_successfully
volumes:
- zrok_env:/mnt
environment:
# internal configuration
HOME: /mnt # zrok homedir in container
# most relevant options
ZROK_UNIQUE_NAME: # name is used to construct frontend domain name, e.g. "myapp" in "myapp.share.zrok.io"
ZROK_BACKEND_MODE: proxy
ZROK_TARGET: http://zrok-test:9090
ZROK_INSECURE: # "--insecure" if proxy target has unverifiable TLS server certificate
ZROK_BASIC_AUTH: # username:password
ZROK_PERMISSION_MODE: closed
ZROK_ACCESS_GRANTS: # space-separated list of additional zrok account emails to grant access in closed permission mode
# least relevant options
ZROK_VERBOSE: # "--verbose"
ZROK_SHARE_OPTS: # additional arguments to "zrok reserve private" command
ZROK_FRONTEND_MODE: reserved-private
PFXLOG_NO_JSON: "true" # suppress JSON logging format
# demo server you can share with zrok
zrok-test:
image: ${ZROK_CONTAINER_IMAGE:-docker.io/openziti/zrok}
command: test endpoint --address 0.0.0.0 # 9090
volumes:
zrok_env:
Thanks for that quick reply @qrkourier - I didn't use your image, I just used your docker file and the demo at least starts up this time.
I think the key was
ZROK_TARGET: http://zrok-test:9090
I noticed that there was a zrok-test
container in the broken compose file, but I wasn't sure how the setup went.
I'll let you know how I go!
1 Like
The ZROK_TARGET
value specifies what you wish to share with zrok. There's no default value. Examples of things you can share are web servers or static files via HTTP, including a website.
I used the compose.yml from the Docker private share guide and defined a few environment variables to represent my private share. You may define env vars in the compose file or in an .env
file in the same directory. As you noted, I set the target to the included testing web server container in the example compose file.