The Crystal compiler, the Shards package manager and various complementary development headers on top of Alpine Linux.
- Build essential packages
- Development headers for:
- Crystal compiler (version
0.27.2
) - Shards (version
0.8.1
)
The Crystal programming language already have an official Docker image at
crystallang/crystal
--- the image being based on Ubuntu
16.04. The Static Linking feature, however, is
currently only supported on Alpine Linux. This image brings the Crystal
compiler and other stuff to Alpine, so you can make static-linked binaries.
- You can build yourself:
docker build -t crystal .
- Or pull from DockerHub:
docker pull caian/crystal:0.27.2-alpine
- Use to build very minimal Docker images of Crystal applications:
FROM caian/crystal:0.27.2-alpine AS build
COPY . /src
WORKDIR /src
RUN shards install
RUN crystal build --release --static app.cr -o app
FROM scratch AS run
COPY --from=build /src/app /app
ENTRYPOINT ["/app"]
To the extent possible under law, Caian Rais Ertl has waived all copyright and related or neighboring rights to this work.