Conversation
2.2 is very old. Pin to a newer version, and keep it up-to-date during rebuilds.
|
I'm currently looking into why the prebuild tests seem to fail if this is raised above HAProxy 2.2. It looks like something may have changed in the 2.4 release of HAProxy, so I'm starting there. |
mariaWitch
left a comment
There was a problem hiding this comment.
Due to HAProxy changing the default user instance for their image after version 2.2, the following needs to be added to the DockerFile:
USER root
This will allow the container to not error out upon launch and will then be able to build successfully.
|
Checking for any additional action on this. |
|
Just set the container to run as root (not ideal), and tested locally and all works as expected. I don't know what's happening with the CI failures. |
|
Can you please try the technique pointed by Maria about the directory? |
This allows haproxy to read the socket, whilst running as a non-privileged user. The container itself needs to run as root to create the group, but haproxy itself changes its own group after startup.
|
The problem with not running as root is more about access to the docker socket than access to |
|
I agree with RealOrangeOne. You can do what mariaWitch says. But to read the .sock you need root permissions. I have not been able to do it without using root either. The change to use haproxy instead of root was made in 2.4 ... The branch we currently use (2.2) has LTS support until 2025. |
mariaWitch
left a comment
There was a problem hiding this comment.
This seems to work on my local setup.
|
Finally, this can be done using "--user=haproxy:<docker_gid>" ... need comment "pidfile" in the configuration due to no have permissions to write there. And can remove '--privileged' flag and use: "--sysctl net.ipv4.ip_unprivileged_port_start=0" More info: docker-library/haproxy#202 Other solution can be... don't use docker-library image and use the image from haproxy: https://github.com/haproxytech/haproxy-docker-alpine |
|
When running this I get Running docker on WSL2 Ubuntu. |
2.2 is very old. Pin to a newer version, and keep it up-to-date during rebuilds.