diff --git a/Dockerfile b/Dockerfile index 63a25be..5688bf7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM haproxy:2.9-alpine3.19 +FROM haproxy:3.3-alpine3.23 USER root @@ -10,7 +10,7 @@ COPY --from=jwilder/docker-gen:latest /usr/local/bin/docker-gen /usr/local/bin/d COPY . /app/ WORKDIR /app/ -ENV DOCKER_HOST unix:///tmp/docker.sock +ENV DOCKER_HOST=unix:///tmp/docker.sock ENTRYPOINT ["/app/docker-entrypoint.sh"] CMD ["/app/haproxy_start.sh"] EXPOSE 80 443 diff --git a/tests/image_structure.bats b/tests/image_structure.bats index ca8ae30..955377a 100644 --- a/tests/image_structure.bats +++ b/tests/image_structure.bats @@ -15,10 +15,12 @@ IMAGE="${IMAGE_NAME:-pygmystack/haproxy:test}" [ -n "$output" ] } -@test "haproxy version is 2.9.x" { +@test "haproxy version matches Dockerfile" { + local expected_version + expected_version="$(grep -oE '^FROM haproxy:[0-9]+\.[0-9]+' "${BATS_TEST_DIRNAME}/../Dockerfile" | grep -oE '[0-9]+\.[0-9]+')" run docker run --rm "${IMAGE}" sh -c 'haproxy -v 2>&1' [ "$status" -eq 0 ] - [[ "$output" =~ "2.9" ]] + [[ "$output" =~ "HAProxy version ${expected_version}" ]] } @test "docker-gen binary is available in PATH" {