File tree Expand file tree Collapse file tree 5 files changed +41
-20
lines changed
Expand file tree Collapse file tree 5 files changed +41
-20
lines changed Original file line number Diff line number Diff line change 33.github /
44.gitattributes
55.gitignore
6+ .dockerignore
67Dockerfile
78bin /run-in-docker.sh
89bin /run-tests-in-docker.sh
910bin /run-tests.sh
1011bin /benchmark.sh
1112bin /benchmark-in-docker.sh
13+ bin /docker-build
1214tests /
Original file line number Diff line number Diff line change 1- # dockerfile recipe from https://github.com/SnappyBeeBit/docker-odin/blob/main/Dockerfile.odin-dev-latest
2-
31ARG ODIN_REF=dev-2025-10
2+ ARG ARCH=amd64
3+ ARG TARBALL="odin-linux-${ARCH}-dev-2025-10-05.tar.gz"
4+ ARG URL="https://github.com/odin-lang/Odin/releases/download/${ODIN_REF}/${TARBALL}"
45
56FROM ubuntu:24.04
67
78ENV DEBIAN_FRONTEND=noninteractive
8- RUN apt-get update && apt-get install -y --no-install-recommends \
9- git build-essential make ca-certificates \
10- clang-18 llvm-18-dev clang \
11- jq gawk locales\
12- && update-ca-certificates \
13- && locale-gen en_US.UTF-8 \
14- && rm -rf /var/lib/apt/lists/*
9+ RUN << END_APT
10+ set -e
11+ apt-get update -y
12+ apt-get install -y --no-install-recommends ca-certificates clang jq gawk locales curl
13+ update-ca-certificates
14+ locale-gen en_US.UTF-8
15+ rm -rf /var/lib/apt/lists/*
16+ END_APT
1517
1618WORKDIR /src
17- ARG ODIN_REF
18- RUN git clone --depth=1 --branch "${ODIN_REF}" https://github.com/odin-lang/Odin.git
19-
20- WORKDIR /src/Odin
21- # Tell the build which llvm-config to use to avoid symlink hacks
22- RUN make -j"$(nproc)" release-native LLVM_CONFIG=llvm-config-18
19+ ARG URL
20+ RUN << END_ODIN
21+ set -e
22+ curl --silent --location "${URL}" | tar zxf -
23+ mv odin* Odin
24+ ls -l Odin
25+ END_ODIN
2326
2427# Fix a bug in this Odin release. When we upgrade, revisit this.
2528RUN sed -E -i '983,984s/\< err\> /marshal_err/g' /src/Odin/core/testing/runner.odin
@@ -29,5 +32,5 @@ ENV ODIN_ROOT=/src/Odin
2932ENV PATH="/src/Odin:${PATH}"
3033
3134WORKDIR /opt/test-runner
32- COPY ./bin/ bin/
35+ COPY . .
3336ENTRYPOINT ["/opt/test-runner/bin/run.sh" ]
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # vim: set ft=bash
3+
4+ image_name=${1:- exercism/ odin-test-runner}
5+
6+ arch=" amd64"
7+ case $( uname -m) in
8+ arm64 | aarch64) arch=arm64 ;;
9+ x86_64) arch=amd64 ;;
10+ esac
11+
12+ docker build --build-arg ARCH=" ${arch} " --rm --tag " ${image_name} " .
Original file line number Diff line number Diff line change @@ -32,8 +32,10 @@ output_dir=$(realpath "${3%/}")
3232# Create the output directory if it doesn't exist
3333mkdir -p " ${output_dir} "
3434
35+ image=" exercism/odin-test-runner"
36+
3537# Build the Docker image
36- docker build --rm -t exercism/odin-test-runner .
38+ bin/ docker- build " ${image} "
3739
3840# Run the Docker image using the settings mimicking the production environment
3941docker run \
@@ -43,4 +45,4 @@ docker run \
4345 --mount type=bind,src=" ${solution_dir} " ,dst=/solution \
4446 --mount type=bind,src=" ${output_dir} " ,dst=/output \
4547 --mount type=tmpfs,dst=/tmp \
46- exercism/odin-test-runner " ${slug} " /solution /output
48+ " ${image} " " ${slug} " /solution /output
Original file line number Diff line number Diff line change 1515# Stop executing when a command returns a non-zero return code
1616set -e
1717
18+ image=" exercism/odin-test-runner"
19+
1820# Build the Docker image
19- docker build --rm -t exercism/odin-test-runner .
21+ bin/ docker- build " ${image} "
2022
2123# Run the Docker image using the settings mimicking the production environment
2224docker run \
@@ -28,4 +30,4 @@ docker run \
2830 --volume " ${PWD} /bin/run-tests.sh:/opt/test-runner/bin/run-tests.sh" \
2931 --workdir /opt/test-runner \
3032 --entrypoint /opt/test-runner/bin/run-tests.sh \
31- exercism/odin-test-runner
33+ " $image "
You can’t perform that action at this time.
0 commit comments