84codes / crystal-container-images Goto Github PK
View Code? Open in Web Editor NEWMulti-arch Crystal images for multiple OSes
License: MIT License
Multi-arch Crystal images for multiple OSes
License: MIT License
Building the following Dockerfile:
FROM 84codes/crystal:1.10.1-alpine
WORKDIR /build
RUN echo -e "require \"big\"\nBigDecimal.new(\"3.14159\")" >test.cr
RUN crystal build --static test.cr
with docker build . --no-cache --progress plain
fails:
#7 0.911 /usr/lib/gcc/aarch64-alpine-linux-musl/12.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: cannot find -lgmp (this usually means you need to install the development package for libgmp): No such file or directory
I get this error when I try to run any of them on my M1 with Docker Desktop 4.12.0 (85629):
$ docker run --rm -it --platform linux/amd64 84codes/crystal:latest-alpine /bin/sh
In bin/sh:1:1
1 | �ELF>��@��
@8
@@@@h����������� � �
^
Error: unknown token: '\u007F'
Other amd64 images work fine here, e.g.:
$ docker run -ti --platform linux/amd64 redis /bin/uname -a
Linux 61fa460521ff 5.10.124-linuxkit #1 SMP PREEMPT Thu Jun 30 08:18:26 UTC 2022 x86_64 GNU/Linux
I cannot compile my project using your Docker image :
earthly --ci --output +all-binaries
Init 🚀
————————————————————————————————————————————————————————————————————————————————
buildkitd | Found buildkit daemon as docker container (earthly-buildkitd)
Build 🔧
————————————————————————————————————————————————————————————————————————————————
internal | --> load metadata for docker.io/84codes/crystal:1.7.3-alpine
binary-file | --> FROM docker.io/84codes/crystal:1.7.3-alpine@sha256:1b219fff024c581ca381b2fe781d1bc02356eb586e810ba7b8c4e63a306c45d5
context | --> local context .
binary-file | [ ] 0% resolve docker.io/84codes/crystal:1.7.3-alpine@sha256:1b219fff024c581ca381b2fe781d1bc02356eb586e810ba7b8c4e63a306c45d5
context | --> local context .
context | --> local context .
context | --> local context .
context | --> local context .
binary-file | [----------] 100% resolve docker.io/84codes/crystal:1.7.3-alpine@sha256:1b219fff024c581ca381b2fe781d1bc02356eb586e810ba7b8c4e63a306c45d5
context | [ ] 0% transferring .:
context | sent 1 file stat)
context | [----------] 100% transferring .:
binary-file | *cached* --> RUN apk add --update --no-cache yaml-static libxml2-dev xz-dev
binary-file | *cached* --> WORKDIR /build
binary-file | *cached* --> COPY shard.yml shard.lock /build/
binary-file | *cached* --> COPY shard.yml shard.lock /build/
binary-file | --> COPY Makefile.release /build/Makefile
binary-file | --> COPY src/ /build/src/
binary-file | --> RUN mkdir /build/bin
binary-file | --> RUN make release
binary-file | Linux buildkitsandbox 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 Linux
binary-file | TARGETPLATFORM: linux/amd64
binary-file | TARGETOS: linux
binary-file | TARGETARCH: amd64
binary-file | TARGETVARIANT:
binary-file | SOURCE_FILE: src/envtpl.cr
binary-file | OUTPUT_FILE: bin/envtpl-linux-amd64
binary-file | shards install --production
binary-file | Resolving dependencies
binary-file | Fetching https://github.com/straight-shoota/crinja.git
binary-file | Fetching https://github.com/crystal-lang/crystal-env.git
binary-file | Installing crinja (0.8.1)
binary-file | Installing crystal-env (0.1.0 at 05a1d92)
binary-file | export LD_LIBRARY_PATH=/usr/lib && crystal build --threads 4 --release --error-trace --static -o bin/envtpl-linux-amd64 src/envtpl.cr
ongoing | binary-file (47 seconds ago)
binary-file | /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lxml2 (this usually means you need to install the development package for libxml2): No such file or directory
binary-file | /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -llzma (this usually means you need to install the development package for liblzma): No such file or directory
binary-file | collect2: error: ld returned 1 exit status
binary-file | Error: execution of command failed with code: 1: `cc "${@}" -o /build/bin/envtpl-linux-amd64 -rdynamic -static -L/usr/bin/../lib/crystal -lxml2 -L/lib -lz -llzma -lm -lpcre -lgc -levent`
binary-file | make: *** [Makefile:26: release] Error 1
binary-file | ERROR
binary-file | The command
binary-file | RUN make release
binary-file | did not complete successfully. Exit code 2
============================= ❌ FAILURE [Build 🔧] ==============================
Repeating the output of the command that caused the failure
binary-file *failed* | --> RUN make release
binary-file *failed* | Linux buildkitsandbox 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 Linux
binary-file *failed* | TARGETPLATFORM: linux/amd64
binary-file *failed* | TARGETOS: linux
binary-file *failed* | TARGETARCH: amd64
binary-file *failed* | TARGETVARIANT:
binary-file *failed* | SOURCE_FILE: src/envtpl.cr
binary-file *failed* | OUTPUT_FILE: bin/envtpl-linux-amd64
binary-file *failed* | shards install --production
binary-file *failed* | Resolving dependencies
binary-file *failed* | Fetching https://github.com/straight-shoota/crinja.git
binary-file *failed* | Fetching https://github.com/crystal-lang/crystal-env.git
binary-file *failed* | Installing crinja (0.8.1)
binary-file *failed* | Installing crystal-env (0.1.0 at 05a1d92)
binary-file *failed* | export LD_LIBRARY_PATH=/usr/lib && crystal build --threads 4 --release --error-trace --static -o bin/envtpl-linux-amd64 src/envtpl.cr
binary-file *failed* | /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lxml2 (this usually means you need to install the development package for libxml2): No such file or directory
binary-file *failed* | /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -llzma (this usually means you need to install the development package for liblzma): No such file or directory
binary-file *failed* | collect2: error: ld returned 1 exit status
binary-file *failed* | Error: execution of command failed with code: 1: `cc "${@}" -o /build/bin/envtpl-linux-amd64 -rdynamic -static -L/usr/bin/../lib/crystal -lxml2 -L/lib -lz -llzma -lm -lpcre -lgc -levent`
binary-file *failed* | make: *** [Makefile:26: release] Error 1
binary-file *failed* | ERROR
binary-file *failed* | The command
binary-file *failed* | RUN make release
binary-file *failed* | did not complete successfully. Exit code 2
Share your logs with an Earthly account (experimental)! Register for one at https://ci.earthly.dev.
make: *** [Makefile:102: release-static] Error 1
It works with the official Crystal Docker image :
earthly --ci --output +all-binaries
Init 🚀
————————————————————————————————————————————————————————————————————————————————
buildkitd | Found buildkit daemon as docker container (earthly-buildkitd)
Build 🔧
————————————————————————————————————————————————————————————————————————————————
internal | --> load metadata for docker.io/crystallang/crystal:1.7.3-alpine
binary-file | --> FROM docker.io/crystallang/crystal:1.7.3-alpine@sha256:ccd2b8866c9869f43692d40420d682038de616131260f00980a533fb63d614b4
context | --> local context .
context | --> local context .
context | --> local context .
binary-file | [ ] 0% resolve docker.io/crystallang/crystal:1.7.3-alpine@sha256:ccd2b8866c9869f43692d40420d682038de616131260f00980a533fb63d614b4
context | --> local context .
context | --> local context .
binary-file | [----------] 100% resolve docker.io/crystallang/crystal:1.7.3-alpine@sha256:ccd2b8866c9869f43692d40420d682038de616131260f00980a533fb63d614b4
context | [ ] 0% transferring .:
context | sent 1 file stat)
context | [----------] 100% transferring .:
binary-file | [----------] 100% sha256:c4fb6df0ef071b2cdfeb81324ad40e1b9c7d1e507a280b74e8f5e53c09a8720e
binary-file | [----------] 100% sha256:da9fa221c987d72c61dbd9e390f2fad47a5f12f2b957d0edefe404823d6e063a
binary-file | [----------] 100% sha256:6b7e20ff70616508b9575cd66f8e47a19cf78d793b745c04f8b834063af101fc
binary-file | [----------] 100% sha256:ef5531b6e74e7865f5d142926b572d742ad47c153211de707903b4f5dd8d9e77
binary-file | [----------] 100% extracting sha256:ef5531b6e74e7865f5d142926b572d742ad47c153211de707903b4f5dd8d9e77
binary-file | [----------] 100% sha256:2330f2db425f5ac87004860bc7e34788b0f1bd14620b28f35a61fd2440d2669a
binary-file | [----------] 100% sha256:e4e10a3579ba29f18ab6e5e68bb28664434e7b864b30aa5d9e5c98d9ca75d7d0
binary-file | [----------] 100% extracting sha256:e4e10a3579ba29f18ab6e5e68bb28664434e7b864b30aa5d9e5c98d9ca75d7d0
binary-file | [----------] 100% extracting sha256:da9fa221c987d72c61dbd9e390f2fad47a5f12f2b957d0edefe404823d6e063a
binary-file | [----------] 100% extracting sha256:c4fb6df0ef071b2cdfeb81324ad40e1b9c7d1e507a280b74e8f5e53c09a8720e
binary-file | [----------] 100% extracting sha256:2330f2db425f5ac87004860bc7e34788b0f1bd14620b28f35a61fd2440d2669a
binary-file | [----------] 100% extracting sha256:6b7e20ff70616508b9575cd66f8e47a19cf78d793b745c04f8b834063af101fc
binary-file | --> RUN apk add --update yaml-static
binary-file | fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
binary-file | fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
binary-file | OK: 168 MiB in 52 packages
binary-file | --> WORKDIR /build
binary-file | --> COPY shard.yml shard.lock /build/
binary-file | --> COPY Makefile.release /build/Makefile
binary-file | --> COPY src/ /build/src/
binary-file | --> RUN mkdir /build/bin
binary-file | --> RUN make release
binary-file | Linux buildkitsandbox 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 Linux
binary-file | TARGETPLATFORM: linux/amd64
binary-file | TARGETOS: linux
binary-file | TARGETARCH: amd64
binary-file | TARGETVARIANT:
binary-file | SOURCE_FILE: src/envtpl.cr
binary-file | OUTPUT_FILE: bin/envtpl-linux-amd64
binary-file | shards install --production
binary-file | Resolving dependencies
binary-file | Fetching https://github.com/straight-shoota/crinja.git
binary-file | Fetching https://github.com/crystal-lang/crystal-env.git
binary-file | Installing crinja (0.8.1)
binary-file | Installing crystal-env (0.1.0 at 05a1d92)
binary-file | crystal build --threads 4 --release --error-trace --static -o bin/envtpl-linux-amd64 src/envtpl.cr
ongoing | binary-file (46 seconds ago)
binary-file | *cached* --> COPY shard.yml shard.lock /build/
binary-file | *cached* --> COPY Makefile.release /build/Makefile
binary-file | *cached* --> COPY src/ /build/src/
binary-file | *cached* --> RUN mkdir /build/bin
binary-file | *cached* --> RUN make release
binary-file | *cached* --> COPY shard.yml shard.lock /build/
binary-file | *cached* --> COPY Makefile.release /build/Makefile
binary-file | *cached* --> COPY src/ /build/src/
binary-file | *cached* --> RUN mkdir /build/bin
binary-file | *cached* --> RUN make release
+build-binary | --> SAVE ARTIFACT /build/bin/envtpl-* +build-binary/envtpl-* AS LOCAL packages/
output | --> exporting outputs
output | [ ] 0% copying files
output | [----------] 100% copying files
context | --> local context .
output | --> exporting outputs
Push Summary ⏫ (disabled)
————————————————————————————————————————————————————————————————————————————————
To enable pushing use earthly --push
Local Output Summary 🎁
————————————————————————————————————————————————————————————————————————————————
Artifact github.com/jbox-web/envtpl.cr:master+build-binary/envtpl-linux-amd64 output as packages/envtpl-linux-amd64
========================== 🌍 Earthly Build ✅ SUCCESS ==========================
Share your logs with an Earthly account (experimental)! Register for one at https://ci.earthly.dev.
cd packages; for f in *; do shasum --algorithm 256 $f > $f.sha256; done
I'd like to use your image to build an arm64 version of my project. (very basic: https://github.com/jbox-web/envtpl.cr)
Thank you!
running any command in my dockerfile
i.e.
FROM 84codes/crystal:latest-alpine as build
RUN apk add gcc
results in an error
0.329 exec /bin/sh: exec format error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.