Skip to content

Commit 3d43c14

Browse files
Add Dockerfiles for build images based on 84codes base images (#332)
These docker files are based on the [images from 84codes](https://hub.docker.com/r/84codes/crystal) and add the specific dependencies required for building the compiler (particularly `libllvm`, `libffi`) and are copied from the existing `alpine.Dockerfile` and `ubuntu.Dockerfile`. This results in up-to-date build images for `linux/arm64` which we're using for Aarch64 CI in crystal-lang/crystal#15007
1 parent 1b7fb7f commit 3d43c14

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

docker/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ $(OUTPUT_DIR)/docker-$(CRYSTAL_VERSION)-alpine-build.tar.gz: $(BUILD_CONTEXT)/al
7373
docker build -t $(DOCKER_TAG_ALPINE)-build --target build $(BUILD_ARGS_ALPINE)
7474
docker save $(DOCKER_TAG_ALPINE)-build | gzip > $@
7575

76+
alpine-84codes: ## Build and push docker build images based on the base images from 84codes
77+
docker buildx build --build-arg crystal_version=$(CRYSTAL_VERSION) -f alpine-84codes.Dockerfile --platform linux/amd64,linux/arm64 --tag crystallang/crystal:$(CRYSTAL_VERSION)-alpine-84codes-build --push .
78+
79+
ubuntu-84codes: ## Build and push docker build images based on the base images from 84codes
80+
docker buildx build --build-arg crystal_version=$(CRYSTAL_VERSION) -f ubuntu-84codes.Dockerfile --platform linux/amd64,linux/arm64 --tag crystallang/crystal:$(CRYSTAL_VERSION)-ubuntu-84codes-build --push .
81+
7682
.PHONY: clean
7783
clean: ## Clean up build and output directories
7884
rm -Rf $(OUTPUT_DIR)

docker/alpine-84codes.Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ARG crystal_version
2+
FROM 84codes/crystal:${crystal_version}-alpine AS build
3+
4+
RUN \
5+
apk add --update --no-cache --force-overwrite \
6+
llvm18-dev llvm18-static g++ libffi-dev
7+
8+
ENTRYPOINT []
9+
CMD ["/bin/sh"]

docker/ubuntu-84codes.Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ARG crystal_version
2+
FROM 84codes/crystal:${crystal_version}-ubuntu-24.04 AS build
3+
4+
RUN \
5+
apt-get update && \
6+
apt-get install -y build-essential llvm-18 lld-18 libedit-dev gdb libffi-dev && \
7+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
8+
9+
RUN ln -sf /usr/bin/ld.lld-18 /usr/bin/ld.lld
10+
11+
ENTRYPOINT []
12+
CMD ["/bin/sh"]

0 commit comments

Comments
 (0)