|
| 1 | +FROM alpine:3.22 |
| 2 | + |
| 3 | +ARG GID=1000 |
| 4 | +ARG UID=1000 |
| 5 | + |
| 6 | +RUN addgroup -g $GID node \ |
| 7 | + && adduser -u $UID -G node -s /bin/sh -D node |
| 8 | + |
| 9 | +RUN apk add --no-cache \ |
| 10 | + libstdc++ \ |
| 11 | + && apk add --no-cache --virtual .build-deps \ |
| 12 | + bash \ |
| 13 | + binutils-gold \ |
| 14 | + curl \ |
| 15 | + g++ \ |
| 16 | + gcc \ |
| 17 | + gnupg \ |
| 18 | + libgcc \ |
| 19 | + linux-headers \ |
| 20 | + make \ |
| 21 | + python3 \ |
| 22 | + ccache \ |
| 23 | + xz \ |
| 24 | + patch \ |
| 25 | + # extra packages required for creating the musl based cross-compiler |
| 26 | + rsync make gcc g++ bzip2 git |
| 27 | + |
| 28 | +COPY <<-EOF /config/config.mak |
| 29 | + # We only set the variables that are really needed, others are the sane defaults from the repo itself |
| 30 | + TARGET = aarch64-linux-musl |
| 31 | + GCC_VER = 14.2.0 |
| 32 | + OUTPUT = /opt/aarch64-linux-musl-cross |
| 33 | +EOF |
| 34 | + |
| 35 | +# set the version we want do use. |
| 36 | +# This is currently set to the last known working commit sha, as the lastest tag (v0.9.11) is not working |
| 37 | +# We specifically don't use the master branch as protection against rougue changes. |
| 38 | +# see following link for more context of what archives are available. |
| 39 | +# https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives#source-code-archive-urls |
| 40 | +RUN RELEASE="3635262e4524c991552789af6f36211a335a77b3" && \ |
| 41 | + wget https://github.com/richfelker/musl-cross-make/archive/${RELEASE}.tar.gz && \ |
| 42 | + tar -xzf ${RELEASE}.tar.gz && \ |
| 43 | + cd /musl-cross-make-${RELEASE} && \ |
| 44 | + make -I /config -j$(getconf _NPROCESSORS_ONLN) && \ |
| 45 | + make -I /config install && \ |
| 46 | + cd / && \ |
| 47 | + rm -rf /musl-cross-make-${RELEASE}/ ${RELEASE}.tar.gz |
| 48 | + |
| 49 | +COPY --chown=node:node run.sh /home/node/run.sh |
| 50 | + |
| 51 | +VOLUME /home/node/.ccache |
| 52 | +VOLUME /out |
| 53 | +VOLUME /home/node/node.tar.xz |
| 54 | + |
| 55 | +USER node |
| 56 | + |
| 57 | +ENTRYPOINT [ "/home/node/run.sh" ] |
0 commit comments