Hi, I'm running a docker container inside wsl ubuntu on windows 10, and I am logged in as root user.
I have a compose.yaml with 3 services (web, postgres and nginx), I try to integrate zrok inside the container but I get the error "unable to load environment; did you 'zrok enable'?".
I am following the guide Getting Started with Docker | Zrok
This is my compose.yaml
Hi @jp17711, welcome to the community and to zrok (and OpenZiti and BrowZer)!
I tried it out real quick on my wsl/ubuntu and can confirm I also get the issue. It looks to me that the problem is going to be with the rootless container and permissions to the zrok folder. I'll give it a whirl on my side and see i can get something working. I'll reply back in a bit.
I think the easiest thing to do for right now is to run the zrok container as root, if you want... It defeats the purpose of running a rootless container though... but you might not care too much.
Option 2 - grant "others" read/execute access to your $HOME/.zrok folder
Doesn't feel like a great answer but it'll work... This let's others read and exec into your directory... The identities in here are 'secrets' so I don't love this approach
chmod -R 705 $HOME/.zrok
Option 3 - most complex
Make a new group for zrok, add your user to the group, chown the .zrok home directory to the zrok group
Thank you very much, I am surprised by the speed of response.
I changed ${UID} to root, but now it gives me the error zrok/endpoints/proxy.newReverseProxy.func2: proxying error: dial tcp [::1]:49152: connect: connection refused
I expect you have created your reserved share with "localhost"? It's easy to forget that the network within docker is different and has different rules. I expect what you actually want was to reference nginx.
Looking back at your ports for nginx I can see: - '49152:80'... You can't use "localhost" in this situation. Instead, you want to zrok share a url that's relative to the zrok container. In your case, I would think you'd want to zrok reserve share public nginx:80 (not "localhost:49152").
Does that make sense? I'm expecting you're exporting port 49152 so your LOCAL machine can also access nginx but if you wanted to, you could actually turn off that exported port and have no exposed ports into your docker environment... (i think that's pretty darn cool)