Skip to content

Commit

Permalink
zig: use via apk
Browse files Browse the repository at this point in the history
That way we won't need to bump zig versions with new releases.
  • Loading branch information
motiejus committed May 3, 2024
1 parent fb3f87f commit e8be936
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
FROM alpine
FROM alpine:edge

# zig is installed from the upstream tarball, because:
# - as of writing, alpine has zig only in testing (which is cumbersome to use)
# - apk get zig pulls in libllvm, which is huge.
#
# Upstream tarball is statically linked, making it small and convenient to use.
RUN apk add make \
&& wget https://ziglang.org/download/0.12.0/zig-linux-$(uname -m)-0.12.0.tar.xz \
&& tar -xJf zig-linux-*.tar.xz \
&& rm zig-linux-*.xz \
&& mv zig-linux-* zig
RUN apk add make zig

WORKDIR inotify-info

COPY . .

RUN CC="/zig/zig cc -target $(uname -m)-linux-musl" \
CXX="/zig/zig c++ -target $(uname -m)-linux-musl" \
RUN CC="zig cc -target $(uname -m)-linux-musl" \
CXX="zig c++ -target $(uname -m)-linux-musl" \
make

FROM scratch
Expand Down

0 comments on commit e8be936

Please sign in to comment.