Open FuckingToasters opened 9 months ago
@flrgh is this related to the prefix location stuff?
@brentos fyi
@flrgh is this related to the prefix location stuff?
This seems to me like a frustrating chicken/egg scenario that I've run into time and time again with docker.
Your prefix volume will be owned by root when docker[-compose] creates it and mounts it into the container at /var/run/kong
, so it cannot be used by an unprivileged user without some initialization. You have a couple options:
The images are built with /usr/local/kong
as the preferred prefix directory, which is created when the kong package is installed and then properly chown-ed to the kong user.
I have yet to find docker documentation that adequately explains this behavior, but when creating a container, mounted volumes interact with the image's filesystem layer in such a way that things are retained from the image layer and even promoted to the volume. Check this out:
You can observe this behavior with (I think) any image and any arbitrary directory. Let's try with a directory /kong
within an ubuntu:jammy
-based image:
If you don't want to use /usr/local/kong
for some reason, you'll need to do some more work to initialize your desired prefix directory before starting kong:
kong-init:
image: alpine:latest
volumes:
- prefix_vol:/kong-prefix
# must use the uid/gid here because the user 'kong' won't
# exist in your bare alpine image
command: chown -Rv 1000:1000 /kong-prefix
...then add kong-init
to depends_on
for your kong service.
Hello, so the portianer logs show following:
I checkd if the folder exist which was not the case so i created the folder and added chmod permission 777 to it, sadly the issue keeps being the same. I also slightly modified the compose file because i dont want to have it exposed on public ips, instead it should only run internally and then i make use of nginx proxy manager to connect it to a domain in order to access it outside of the vps.
Here the docker-compose.yml file i use as a portainer stack: