Skip to content

Commit

Permalink
feat(Dockerfile.crystal): build alpine image with llvm 18
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach authored Oct 24, 2024
1 parent f4e4917 commit f53f05a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Dockerfile.crystal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG alpine_version=latest

FROM --platform=$BUILDPLATFORM alpine:$alpine_version AS builder
ARG llvm_version=16
ARG llvm_version=18
# add dependencies required for building crystal from source
RUN apk add --update --no-cache \
crystal shards \
Expand All @@ -12,12 +12,11 @@ RUN apk add --update --no-cache \
ARG TARGETARCH
# Build crystal
WORKDIR /usr/src/crystal
ARG crystal_version=1.12.1
ARG crystal_version=1.14.0
RUN git clone --depth=1 --single-branch --branch=$crystal_version https://github.com/crystal-lang/crystal.git . && \
gzip -9 man/crystal.1 && \
mkdir .build && \
make crystal static=1 release=1 target=$TARGETARCH-alpine-linux-musl PREFIX=/usr FLAGS="--no-debug" | tail -1 > .build/crystal.sh && \
rm src/llvm/ext/llvm_ext.o
make crystal static=1 release=1 target=$TARGETARCH-alpine-linux-musl PREFIX=/usr FLAGS="--no-debug" | tail -1 > .build/crystal.sh
# Build shards
WORKDIR /usr/src/shards
ARG shards_version=0.18.0
Expand All @@ -27,7 +26,7 @@ RUN git clone --depth=1 --single-branch --branch=v${shards_version} https://gith

# link on target platform
FROM alpine:$alpine_version AS target-builder
ARG llvm_version=16
ARG llvm_version=18
RUN apk add --update --no-cache \
llvm${llvm_version}-dev llvm${llvm_version}-static \
zlib-static yaml-static libxml2 libxml2-dev pcre2-dev libevent-static \
Expand All @@ -36,7 +35,7 @@ RUN apk add --update --no-cache libxml2-static || true
RUN apk add --update --no-cache zstd-static || true
# Build libgc
WORKDIR /usr/src/libc
ARG gc_version=8.2.4
ARG gc_version=8.2.6
RUN git clone --depth=1 --single-branch --branch=v${gc_version} https://github.com/ivmai/bdwgc.git . && \
./autogen.sh && \
./configure --disable-debug --disable-shared --enable-large-config --prefix=/usr && \
Expand Down

0 comments on commit f53f05a

Please sign in to comment.