Skip to content

Commit

Permalink
Add linux-arm64-lts and linux-arm64-musl images (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSnow authored Jul 1, 2022
1 parent 80cae33 commit 901f570
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- linux-armv6
- linux-armv7
- linux-arm64
- linux-arm64-lts
- linux-arm64-musl
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- linux-armv6
- linux-armv7
- linux-arm64
- linux-arm64-lts
- linux-arm64-musl
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ Cross-compile for Linux ARM. This image thinly wraps a [`dockcross`](https://git

Cross-compile for Linux ARM. This image thinly wraps a [`dockcross`](https://github.com/dockcross/dockcross) image. Preconfigures `prebuildify` to [tag](https://github.com/prebuild/prebuildify#options) prebuilds with the armv version (8).

### [`linux-arm64-lts`](https://github.com/orgs/prebuild/packages/container/package/linux-arm64-lts)

Cross-compile for Linux ARM. This image uses an old version of glibc (glibc 2.27) for compatibility. This image thinly wraps a [`dockcross`](https://github.com/dockcross/dockcross) image. Preconfigures `prebuildify` to [tag](https://github.com/prebuild/prebuildify#options) prebuilds with the armv version (8).

### [`linux-arm64-musl`](https://github.com/orgs/prebuild/packages/container/package/linux-arm64-musl)

Cross-compile for Linux ARM. This image uses musl instead of glibc for Alpine linux. This image thinly wraps a [`dockcross`](https://github.com/dockcross/dockcross) image. Preconfigures `prebuildify` to [tag](https://github.com/prebuild/prebuildify#options) prebuilds with the armv version (8).

### [`android-armv7`](https://github.com/orgs/prebuild/packages/container/package/android-armv7)

Cross-compile for Android ARM. This image thinly wraps a [`dockcross`](https://github.com/dockcross/dockcross) image. Preconfigures `prebuildify` to [tag](https://github.com/prebuild/prebuildify#options) prebuilds with the armv version (7).
Expand Down
43 changes: 43 additions & 0 deletions linux-arm64-lts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM dockcross/linux-arm64-lts

RUN groupadd --gid 1000 node && useradd --uid 1000 --gid node --shell /bin/bash --create-home node && \
groupadd --gid 2000 travis && useradd --uid 2000 --gid travis --shell /bin/bash --create-home travis && \
apt-get -y update && \
apt-get -y --no-install-recommends install git curl gnupg apt-transport-https && \
echo Package: nodejs >> /etc/apt/preferences.d/preferences && \
echo Pin: origin deb.nodesource.com >> /etc/apt/preferences.d/preferences && \
echo Pin-Priority: 1000 >> /etc/apt/preferences.d/preferences && \
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get -y install nodejs && \
npm -v && \
test -f ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip && \
rm -rf /var/lib/apt/lists/*

USER node
ENV HOME /home/node

ENV PREBUILD_STRIP_BIN ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip
ENV PREBUILD_ARCH arm64
ENV PREBUILD_ARMV 8
ENV PREBUILD_PLATFORM linux

# TODO: These are for backwards compat. Remove once we have versioning.
ENV STRIP ${PREBUILD_STRIP_BIN}
ENV ARCH ${PREBUILD_ARCH}
ENV ARM_VERSION ${PREBUILD_ARMV}
ENV TARGET_PLATFORM ${PREBUILD_PLATFORM}

# Disable npm update check
ENV NO_UPDATE_NOTIFIER true
ENV npm_config_update_notifier false

# Set inherited dockcross labels to empty values.
# Labels can't be deleted (https://github.com/moby/moby/issues/3465)
LABEL org.label-schema.build-date=
LABEL org.label-schema.name=
LABEL org.label-schema.schema-version=
LABEL org.label-schema.vcs-ref=
LABEL org.label-schema.vcs-url=
LABEL org.label-schema.version=

WORKDIR /app
43 changes: 43 additions & 0 deletions linux-arm64-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM dockcross/linux-arm64-musl

RUN groupadd --gid 1000 node && useradd --uid 1000 --gid node --shell /bin/bash --create-home node && \
groupadd --gid 2000 travis && useradd --uid 2000 --gid travis --shell /bin/bash --create-home travis && \
apt-get -y update && \
apt-get -y --no-install-recommends install git curl gnupg apt-transport-https && \
echo Package: nodejs >> /etc/apt/preferences.d/preferences && \
echo Pin: origin deb.nodesource.com >> /etc/apt/preferences.d/preferences && \
echo Pin-Priority: 1000 >> /etc/apt/preferences.d/preferences && \
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get -y install nodejs && \
npm -v && \
test -f ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip && \
rm -rf /var/lib/apt/lists/*

USER node
ENV HOME /home/node

ENV PREBUILD_STRIP_BIN ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip
ENV PREBUILD_ARCH arm64
ENV PREBUILD_ARMV 8
ENV PREBUILD_PLATFORM linux

# TODO: These are for backwards compat. Remove once we have versioning.
ENV STRIP ${PREBUILD_STRIP_BIN}
ENV ARCH ${PREBUILD_ARCH}
ENV ARM_VERSION ${PREBUILD_ARMV}
ENV TARGET_PLATFORM ${PREBUILD_PLATFORM}

# Disable npm update check
ENV NO_UPDATE_NOTIFIER true
ENV npm_config_update_notifier false

# Set inherited dockcross labels to empty values.
# Labels can't be deleted (https://github.com/moby/moby/issues/3465)
LABEL org.label-schema.build-date=
LABEL org.label-schema.name=
LABEL org.label-schema.schema-version=
LABEL org.label-schema.vcs-ref=
LABEL org.label-schema.vcs-url=
LABEL org.label-schema.version=

WORKDIR /app

0 comments on commit 901f570

Please sign in to comment.