using tini to reap zombie processes

This commit is contained in:
Julien Neuhart
2019-09-30 20:17:39 +02:00
parent 7f61c63425
commit cbc9d9ab8c
2 changed files with 19 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ DOCKER_PASSWORD=
DOCKER_REPOSITORY=thecodingmachine
GOLANGCI_LINT_VERSION=1.19.1
CODE_COVERAGE=0
TINI_VERSION=v0.18.0
MAXIMUM_WAIT_TIMEOUT=30.0
MAXIMUM_WAIT_DELAY=10.0
MAXIMUM_WEBHOOK_URL_TIMEOUT=30.0
@@ -48,7 +49,7 @@ doc:
# build Gotenberg Docker image.
image:
make workspace
docker build --build-arg VERSION=$(VERSION) -t $(DOCKER_REPOSITORY)/gotenberg:$(VERSION) -f build/package/Dockerfile .
docker build --build-arg VERSION=$(VERSION) --build-arg TINI_VERSION=$(TINI_VERSION) -t $(DOCKER_REPOSITORY)/gotenberg:$(VERSION) -f build/package/Dockerfile .
# start the API using previously built Docker image.
gotenberg:

View File

@@ -29,6 +29,23 @@ COPY cmd ./cmd
# Build our binary.
RUN go build -o gotenberg -ldflags "-X main.version=${VERSION}" cmd/gotenberg/main.go
FROM thecodingmachine/gotenberg:base
LABEL authors="Julien Neuhart <j.neuhart@thecodingmachine.com>"
# |--------------------------------------------------------------------------
# | Tini
# |--------------------------------------------------------------------------
# |
# | An helper for reaping zombie processes.
# |
ARG TINI_VERSION
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
# |--------------------------------------------------------------------------
# | Final touch
# |--------------------------------------------------------------------------
@@ -36,10 +53,6 @@ RUN go build -o gotenberg -ldflags "-X main.version=${VERSION}" cmd/gotenberg/ma
# | Last instructions of this build.
# |
FROM thecodingmachine/gotenberg:base
LABEL authors="Julien Neuhart <j.neuhart@thecodingmachine.com>"
COPY --from=workspace /gotenberg/package/gotenberg /usr/local/bin/
USER gotenberg