Skip to content

Commit

Permalink
Make the debian based version the default
Browse files Browse the repository at this point in the history
Maybe having openssl compiled into a static binrary is not what I want anyway
(Docker does suffer from this problem either way, but I don't want that responsibility)
  • Loading branch information
jcaesar committed Jun 23, 2019
1 parent d1b9231 commit a7915c6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
21 changes: 13 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
FROM gentoo/portage:latest as portage
FROM liftm/gentoo-uclibc:static as builder
COPY --from=portage /usr/portage /usr/portage
FROM debian:buster as builder

RUN emerge --autounmask-write --autounmask-continue --tree --verbose \
kafkacat meson dev-util/ninja app-arch/zstd app-arch/lz4 dev-libs/cyrus-sasl jq
RUN apt update \
&& apt install -y \
jq \
build-essential pkg-config \
libssl-dev libsasl2-dev \
meson ninja-build \
wget ca-certificates \
musl-tools

WORKDIR /opt/kafkacat
COPY . .
RUN true \
&& ver=$(sed -rn "H;1h;\$!d;x;s/^.*project\([^)]*kafkacat[^)]*version:[ \t]*'([^']+)'.*$/\1/p" meson.build) \
&& wget https://github.com/edenhill/kafkacat/archive/$ver.tar.gz -O/opt/src.tgz \
&& tar --strip-components=1 -xvf /opt/src.tgz \
&& meson build --wrap-mode forcefallback -Ddefault_library=static -Dstatic=true \
&& test "$(meson introspect --projectinfo build | jq -r .version)" == $ver \
&& ninja -C build kafkacat \
&& CC=musl-gcc meson build --wrap-mode forcefallback \
-Ddefault_library=static -Dstatic=true -Drdkafka:WITH_SSL=disabled -Drdkafka:WITH_SASL=disabled \
&& /usr/bin/test "$(meson introspect --projectinfo build | jq -r .version)" == $ver \
&& ninja -Cbuild kafkacat \
&& ldd build/kafkacat | grep -q 'not.*dynamic'

FROM scratch
Expand Down
27 changes: 0 additions & 27 deletions debian.Dockerfile

This file was deleted.

22 changes: 22 additions & 0 deletions gentoo-uclibc-with-ssl.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM gentoo/portage:latest as portage
FROM liftm/gentoo-uclibc:static as builder
COPY --from=portage /usr/portage /usr/portage

RUN emerge --autounmask-write --autounmask-continue --tree --verbose \
kafkacat meson dev-util/ninja app-arch/zstd app-arch/lz4 dev-libs/cyrus-sasl jq

WORKDIR /opt/kafkacat
COPY . .
RUN true \
&& ver=$(sed -rn "H;1h;\$!d;x;s/^.*project\([^)]*kafkacat[^)]*version:[ \t]*'([^']+)'.*$/\1/p" meson.build) \
&& wget https://github.com/edenhill/kafkacat/archive/$ver.tar.gz -O/opt/src.tgz \
&& tar --strip-components=1 -xvf /opt/src.tgz \
&& meson build --wrap-mode forcefallback -Ddefault_library=static -Dstatic=true \
&& test "$(meson introspect --projectinfo build | jq -r .version)" == $ver \
&& ninja -C build kafkacat \
&& ldd build/kafkacat | grep -q 'not.*dynamic'

FROM scratch
USER 1000
ENTRYPOINT ["/kafkacat"]
COPY --from=builder /opt/kafkacat/build/kafkacat /

0 comments on commit a7915c6

Please sign in to comment.