Skip to content

Commit

Permalink
Merge pull request #7187 from iav/docker-tini-choose-arch
Browse files Browse the repository at this point in the history
Choose architecture when download tini into docker container
  • Loading branch information
Stebalien authored Apr 21, 2020
2 parents 9033ba9 + d6bee38 commit c94c623
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ RUN cd $SRC_DIR \
# and tini, a very minimal init daemon for containers
ENV SUEXEC_VERSION v0.2
ENV TINI_VERSION v0.18.0
RUN set -x \
&& cd /tmp \
RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
"amd64" | "armhf" | "arm64") tiniArch="tini-$dpkgArch" ;;\
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
cd /tmp \
&& git clone https://github.com/ncopa/su-exec.git \
&& cd su-exec \
&& git checkout -q $SUEXEC_VERSION \
&& make \
&& cd /tmp \
&& wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini \
&& wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/$tiniArch \
&& chmod +x tini

# Now comes the actual target image, which aims to be as small as possible.
Expand Down

0 comments on commit c94c623

Please sign in to comment.