Skip to content

Commit f05d522

Browse files
authored
Merge pull request #25 from dash14/refactor/s6-readiness-notification
Replace Docker healthcheck with s6 readiness notifications
2 parents 8a28180 + 43ae83b commit f05d522

File tree

19 files changed

+15
-32
lines changed

19 files changed

+15
-32
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ jobs:
9090
run: node report/main.mjs ./compose.yml || true
9191

9292
- name: Run assertions
93+
env:
94+
BUILDER_NAME: ${{ matrix.builder_name }}
9395
run: ${{ matrix.assert_script }}
9496

9597
- name: Cleanup

compose.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,3 @@ services:
3333
- ALLOWED_IP_RULES=${ALLOWED_IP_RULES:-}
3434
- EXTERNAL_RESOLVER=${EXTERNAL_RESOLVER:-1.1.1.1,8.8.8.8}
3535
restart: unless-stopped
36-
healthcheck:
37-
test: ["CMD", "sh", "-c", "curl -sf --unix-socket /var/run/haproxy-health.sock http://localhost/health"]
38-
interval: 30s
39-
timeout: 5s
40-
retries: 10
41-
start_period: 5s

docker/Dockerfile

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
ARG BUILDKIT_VERSION=v0.28.0
22
ARG CNI_VERSION=v1.9.0
33
ARG ALPINE_RELEASE=3.23
4-
ARG S6_OVERLAY_VERSION=v3.2.2.0
5-
64
# Prepare dependencies
75
FROM alpine:$ALPINE_RELEASE AS deps
86
ARG CNI_VERSION
@@ -21,22 +19,13 @@ LABEL org.opencontainers.image.title="buildcage" \
2119
org.opencontainers.image.source="https://github.com/dash14/buildcage"
2220

2321
RUN apk add --no-cache \
22+
s6-overlay \
2423
haproxy \
2524
dnsmasq \
2625
iptables \
2726
curl \
2827
quickjs
2928

30-
# s6-overlay
31-
ARG S6_OVERLAY_VERSION
32-
RUN apk add --no-cache xz && \
33-
S6_ARCH=$(uname -m) && \
34-
curl -fsSL "https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" \
35-
| xz -d | tar -C / -xpf - && \
36-
curl -fsSL "https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz" \
37-
| xz -d | tar -C / -xpf - && \
38-
apk del xz
39-
4029
ENV S6_KEEP_ENV=1
4130
ENV S6_LOGGING=0
4231

@@ -68,10 +57,5 @@ COPY files/THIRD_PARTY_LICENSES /opt/buildcage/THIRD_PARTY_LICENSES
6857
# s6 service definitions and init scripts
6958
COPY files/s6-rc.d/ /etc/s6-overlay/s6-rc.d/
7059
COPY files/s6-scripts/ /etc/s6-overlay/scripts/
71-
RUN chmod +x /etc/s6-overlay/scripts/* && \
72-
chmod +x /etc/s6-overlay/s6-rc.d/dnsmasq/run && \
73-
chmod +x /etc/s6-overlay/s6-rc.d/haproxy/run && \
74-
chmod +x /etc/s6-overlay/s6-rc.d/haproxy-log/run
7560

7661
ENTRYPOINT ["/init"]
77-
CMD ["buildkitd", "--oci-worker-net=cni"]

docker/files/s6-rc.d/buildkitd/dependencies.d/dnsmasq

Whitespace-only changes.

docker/files/s6-rc.d/buildkitd/dependencies.d/haproxy

Whitespace-only changes.

docker/files/s6-rc.d/buildkitd/dependencies.d/init-iptables

Whitespace-only changes.

docker/files/s6-rc.d/buildkitd/run

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/command/with-contenv sh
2+
exec buildkitd --oci-worker-net=cni
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
longrun
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
nslookup localhost 127.0.0.1 > /dev/null 2>&1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3

0 commit comments

Comments
 (0)