Skip to content

Commit

Permalink
fix(build): use tini to reap zombie processes (akuity#2959)
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
(cherry picked from commit 34c6128)
  • Loading branch information
hiddeco committed Nov 19, 2024
1 parent 6655061 commit 2c53d0c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.4.15 && \
####################################################################################################
FROM alpine:latest AS back-end-dev

RUN apk update && apk add ca-certificates git gpg gpg-agent openssh-client
RUN apk update && apk add ca-certificates git gpg gpg-agent openssh-client tini

COPY bin/credential-helper /usr/local/bin/credential-helper
COPY bin/controlplane/kargo /usr/local/bin/kargo

RUN adduser -D -H -u 1000 kargo
USER 1000:0

ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/local/bin/kargo"]

####################################################################################################
Expand Down Expand Up @@ -119,4 +120,5 @@ FROM ${BASE_IMAGE}:latest-${TARGETARCH} AS final
COPY --from=back-end-builder /kargo/bin/ /usr/local/bin/
COPY --from=tools /tools/ /usr/local/bin/

ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/local/bin/kargo"]
3 changes: 2 additions & 1 deletion charts/kargo/templates/controller/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ spec:
- name: controller
image: {{ include "kargo.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/kargo", "controller"]
command: ["/sbin/tini", "--", "/usr/local/bin/kargo"]
args: ["controller"]
{{- with (concat .Values.global.env .Values.controller.env) }}
env:
{{- toYaml . | nindent 8 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/kargo/templates/garbage-collector/cron-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ spec:
- name: garbage-collector
image: {{ include "kargo.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/kargo", "garbage-collector"]
command: ["/sbin/tini", "--", "/usr/local/bin/kargo"]
args: ["garbage-collector"]
{{- with (concat .Values.global.env .Values.garbageCollector.env) }}
env:
{{- toYaml . | nindent 12 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/kargo/templates/management-controller/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ spec:
- name: management-controller
image: {{ include "kargo.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/kargo", "management-controller"]
command: ["/sbin/tini", "--", "/usr/local/bin/kargo"]
args: ["management-controller"]
{{- with (concat .Values.global.env .Values.managementController.env) }}
env:
{{- toYaml . | nindent 8 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/kargo/templates/webhooks-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ spec:
- name: webhooks-server
image: {{ include "kargo.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/kargo", "webhooks-server"]
command: ["/sbin/tini", "--", "/usr/local/bin/kargo"]
args: ["webhooks-server"]
{{- with (concat .Values.global.env .Values.webhooksServer.env) }}
env:
{{- toYaml . | nindent 8 }}
Expand Down
1 change: 1 addition & 0 deletions kargo-base.apko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ contents:
- gpg-agent~2
- helm~3 # Required for Kustomize Helm plugin
- openssh-client~9
- tini

accounts:
groups:
Expand Down

0 comments on commit 2c53d0c

Please sign in to comment.