-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4541: chore(docker): minor improvements r=npepinpe a=npepinpe ## Description - switches base image from openjdk:jre-11 to openjdk:jre-11-slim for a slightly smaller image - introduces multi stage build to avoid having the distball copy layer The goal of the PR is to reduce the amount of data one has to push when pushing the image. Previously, we were pushing two layers: the distball copy, and the distball untarring. This is now squashed into a single layer thanks to the multi-stage build. Using the `slim` variant of the original image also allows us to eschew some typical actions like removing the apt cache, or removing curl, etc., as this is already done for us. Note that omitting the target flag will still result in a valid image, but in the case where we one day have multiple images, it's better to get in the habit. # 4589: chore(atomix): fix flaky test r=pihme a=Zelldon # Description We need to wait until all entries are replicated to all nodes to make the test reliable. Tried it locally after 26 runs the test failed, after fixing it I run it 100 times without any failures. <!-- Please explain the changes you made here. --> ## Related issues <!-- Which issues are closed by this PR or are related --> closes #4588 # Co-authored-by: Nicolas Pépin-Perreault <nicolas.pepin-perreault@camunda.com> Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
- Loading branch information
Showing
6 changed files
with
28 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh -eux | ||
|
||
echo "Building Zeebe Docker image ${IMAGE}:${TAG}" | ||
docker build --no-cache --build-arg DISTBALL=zeebe-distribution.tar.gz -t ${IMAGE}:${TAG} . | ||
docker build --no-cache --build-arg DISTBALL=zeebe-distribution.tar.gz -t ${IMAGE}:${TAG} --target app . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
FROM openjdk:11-jre | ||
|
||
FROM alpine:latest as builder | ||
ARG DISTBALL | ||
|
||
ENV TMP_ARCHIVE=/tmp/zeebe.tar.gz \ | ||
TMP_DIR=/tmp/zeebe \ | ||
TINI_VERSION=v0.19.0 | ||
|
||
COPY ${DISTBALL} ${TMP_ARCHIVE} | ||
|
||
RUN mkdir -p ${TMP_DIR} && \ | ||
tar xfvz ${TMP_ARCHIVE} --strip 1 -C ${TMP_DIR} && \ | ||
# already create volume dir to later have correct rights | ||
mkdir ${TMP_DIR}/data | ||
|
||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini ${TMP_DIR}/bin/tini | ||
COPY docker/utils/startup.sh ${TMP_DIR}/bin/startup.sh | ||
RUN chmod +x -R ${TMP_DIR}/bin/ | ||
|
||
FROM openjdk:11-jre-slim as app | ||
|
||
ENV ZB_HOME=/usr/local/zeebe \ | ||
ZEEBE_LOG_LEVEL=info \ | ||
ZEEBE_BROKER_GATEWAY_NETWORK_HOST=0.0.0.0 \ | ||
ZEEBE_STANDALONE_GATEWAY=false | ||
ENV PATH "${ZB_HOME}/bin:${PATH}" | ||
|
||
ADD https://github.com/krallin/tini/releases/download/v0.18.0/tini /bin/tini | ||
RUN chmod +x /bin/tini | ||
|
||
COPY ${DISTBALL} ${ZB_HOME}/ | ||
|
||
RUN tar xfvz ${ZB_HOME}/*.tar.gz --strip 1 -C ${ZB_HOME}/ && rm ${ZB_HOME}/*.tar.gz | ||
|
||
WORKDIR ${ZB_HOME} | ||
EXPOSE 26500 26501 26502 | ||
VOLUME ${ZB_HOME}/data | ||
|
||
COPY docker/utils/startup.sh /usr/local/bin | ||
ENTRYPOINT ["tini", "--", "/usr/local/bin/startup.sh"] | ||
COPY --from=builder /tmp/zeebe ${ZB_HOME} | ||
|
||
### Set execution flag (otherwise, if image is built in a Windows environment, the start scripts won't be executable) | ||
# Set execution flag (otherwise, if image is built in a Windows environment, the start scripts | ||
# won't be executable) | ||
RUN chmod +x ${ZB_HOME}/bin/broker | ||
RUN chmod +x ${ZB_HOME}/bin/gateway | ||
|
||
RUN apt-get --purge remove -y --auto-remove curl | ||
|
||
ENTRYPOINT ["tini", "--", "/usr/local/bin/startup.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
To run the upgradability tests, a Docker image for Zeebe must be built with the tag 'current-test'. To do that you can run (in the zeebe-io/zeebe dir): | ||
|
||
``` | ||
docker build --build-arg DISTBALL=dist/target/zeebe-distribution*.tar.gz -t camunda/zeebe:current-test . | ||
docker build --build-arg DISTBALL=dist/target/zeebe-distribution*.tar.gz -t camunda/zeebe:current-test --target app . | ||
``` | ||
|