Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CurrentContainerID is blank when /var/lib/docker/containers is a separate mount point on the host #452

Open
eigood opened this issue Jul 22, 2022 · 2 comments

Comments

@eigood
Copy link

eigood commented Jul 22, 2022

regex = fmt.Sprintf("containers/%v", regex)

My machine is currently not fetching .Docker.CurrentContainerID, it ends up being blank. I have a separate mountpoint for /var/lib/docker/containers, so any sub-relative paths don't have the /containers/ prefix in the container view.

2939 2016 0:96 / /dev/shm rw,nosuid,nodev,noexec,relatime - tmpfs shm rw,size=65536k,inode64
2940 2014 0:23 /docker.sock /tmp/docker.sock ro,relatime - tmpfs tmpfs rw,size=6578076k,mode=755,inode64
2941 2014 253:5 /17dc78431e3a010258883e916885bde27da979734063d00a5900a3ddd3ca61d8/hosts /etc/hosts rw,relatime - ext4 /dev/mapper/tooz--fast-docker--containers rw,errors=remount-ro,stripe=256
2942 2014 253:5 /17dc78431e3a010258883e916885bde27da979734063d00a5900a3ddd3ca61d8/resolv.conf /etc/resolv.conf rw,relatime - ext4 /dev/mapper/tooz--fast-docker--containers rw,errors=remount-ro,stripe=256
2943 2014 253:5 /17dc78431e3a010258883e916885bde27da979734063d00a5900a3ddd3ca61d8/hostname /etc/hostname rw,relatime - ext4 /dev/mapper/tooz--fast-docker--containers rw,errors=remount-ro,stripe=256
2944 2014 253:7 /nginx_nginxproxy-conf/_data /etc/nginx/conf.d rw,relatime master:62 - ext4 /dev/mapper/tooz--fast-docker--volumes rw,errors=remount-ro,stripe=256
2945 2014 253:7 /nginx_nginxproxy-vhost/_data /etc/nginx/vhost.d ro,relatime master:62 - ext4 /dev/mapper/tooz--fast-docker--volumes rw,errors=remount-ro,stripe=256
@eigood
Copy link
Author

eigood commented Jul 22, 2022

I can confirm that if I don't put a separate LVM on /var/lib/docker/containers, then docker-gen works and finds it's own container id.

@Hulkstern
Copy link

I also stumbled upon this issue inadvertently ran into when I setup zfs for my /var/lib/docker directory as well as a dataset for every sub directory of /var/lib/docker

To help those who are also having the same issue I was. Since I setup a zfs dataset for every sub directory of my /var/lib/docker my jwilder/nginx-proxy container was no longer able to generate the /etc/nginx/conf.d/default.conf file correctly since docker-gen could not correctly refer to containers. Which then broke my reverse proxy for my services/sites. I would simply get a 502 error with the nginx log entry of

no live upstreams while connecting to upstream, client: [CLIENT-IP], server: [MY-DOMAIN], request: "GET / HTTP/1.1", upstream: "http://[MY-DOMAIN]/", host: "[MY-DOMAIN]", referrer: "http://[MY-DOMAIN]/"

Hopefully the smattering of keywords I've put here will help someone googling a solution to the problem this behavior causes for the reverse-proxy image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants