-
Notifications
You must be signed in to change notification settings - Fork 1
/
alpine.Dockerfile
75 lines (63 loc) · 1.99 KB
/
alpine.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM alpine:3.20.1 AS nim
ARG version_nim=2.0.8
RUN \
apk --no-cache add \
musl-dev \
curl \
xz \
gcc \
openssl \
ca-certificates \
git && \
rm -fr /var/cache/apk/*
WORKDIR /src
RUN \
curl -fsSLO https://nim-lang.org/download/nim-${version_nim}.tar.xz && \
tar -xJf nim-${version_nim}.tar.xz && \
cd nim-${version_nim} && \
sh build.sh && \
bin/nim c koch && \
chmod +x koch && \
./koch boot -d:release && \
./koch tools && \
sh install.sh /usr/bin
FROM alpine:3.20.1
# Nim Semver
ARG version_nim=2.0.8
# Image Metadata
ARG BUILD_VERSION
ARG BUILD_REVISION
ARG BUILD_DATE
# Make Binaries installed through Nimble available
ENV PATH=/root/.nimble/bin:$PATH
LABEL maintainer="Akito <[email protected]>"
LABEL org.opencontainers.image.authors="Akito <[email protected]>"
LABEL org.opencontainers.image.vendor="Akito"
LABEL org.opencontainers.image.version="${BUILD_VERSION}"
LABEL org.opencontainers.image.revision="${BUILD_REVISION}"
LABEL org.opencontainers.image.created="${BUILD_DATE}"
LABEL org.opencontainers.image.title="Multi-Arch Nim Compiler"
LABEL org.opencontainers.image.description="Nim Compiler for multiple CPU architectures built with musl on Alpine."
LABEL org.opencontainers.image.url="https://hub.docker.com/r/akito13/nim"
LABEL org.opencontainers.image.documentation="https://github.com/theAkito/docker-nim?tab=readme-ov-file#run"
LABEL org.opencontainers.image.source="https://github.com/theAkito/docker-nim"
LABEL org.opencontainers.image.licenses="GPL-3.0+"
# Copy from Source directory, rather than from /usr/bin.
# https://github.com/nim-lang/Nim/issues/18979
COPY --from=nim /src/nim-${version_nim}/bin /usr/bin
COPY --from=nim /usr/lib/nim /usr/lib/nim
COPY --from=nim /etc/nim /etc/nim
RUN \
apk --no-cache add \
# Nim Dependencies
musl-dev \
gcc \
# Nimble Dependencies
curl \
openssl \
ca-certificates \
git && \
# Clean up
rm -fr /var/cache/apk/* && \
# Fix Nim Installation
ln -s /usr/lib/nim /usr/lib/nim/lib