Skip to content

Commit 7bc0a0a

Browse files
Updated the underlying haproxy version from 2.2 to 3.2.4
Fixed CI Reverted conftests.py, Added root user before CMD in Dockerfile, to respect existing setups version pinned and comment removed from cfg Removed extra empty lines
1 parent 2712f13 commit 7bc0a0a

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM haproxy:2.2-alpine
1+
FROM haproxy:3.2.4-alpine
22

33
EXPOSE 2375
44
ENV ALLOW_RESTARTS=0 \
@@ -33,3 +33,5 @@ ENV ALLOW_RESTARTS=0 \
3333
VOLUMES=0
3434
COPY docker-entrypoint.sh /usr/local/bin/
3535
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg.template
36+
USER root
37+
CMD ["haproxy", "-f", "/tmp/haproxy.cfg"]

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ case "$DISABLE_IPV6_LOWER" in
1515
esac
1616

1717
# Process the HAProxy configuration template using sed
18-
sed "s/\${BIND_CONFIG}/$BIND_CONFIG/g" /usr/local/etc/haproxy/haproxy.cfg.template > /usr/local/etc/haproxy/haproxy.cfg
18+
sed "s/\${BIND_CONFIG}/$BIND_CONFIG/g" /usr/local/etc/haproxy/haproxy.cfg.template > /tmp/haproxy.cfg
1919

2020
# first arg is `-f` or `--some-option`
2121
if [ "${1#-}" != "$1" ]; then

haproxy.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ backend docker-events
4444
timeout server 0
4545

4646
frontend dockerfrontend
47+
# bind [::]:2375 v4v6
4748
bind ${BIND_CONFIG}
4849
http-request deny unless METH_GET || { env(POST) -m bool }
50+
51+
# Allowed endpoints
4952
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/((stop)|(restart)|(kill)) } { env(ALLOW_RESTARTS) -m bool }
5053
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start } { env(ALLOW_START) -m bool }
5154
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop } { env(ALLOW_STOP) -m bool }
@@ -73,6 +76,6 @@ frontend dockerfrontend
7376
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/version } { env(VERSION) -m bool }
7477
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/volumes } { env(VOLUMES) -m bool }
7578
http-request deny
76-
default_backend dockerbackend
7779

80+
default_backend dockerbackend
7881
use_backend docker-events if { path,url_dec -m reg -i ^(/v[\d\.]+)?/events }

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[tool.poetry]
22
name = "docker-socket-proxy"
3-
version = "0.0.0"
3+
version = "1.0.0"
44
description = ""
55
authors = ["Tecnativa"]
6+
package-mode = false
67

78
[tool.poetry.dependencies]
89
python = "^3.8"

0 commit comments

Comments
 (0)