Skip to content

Commit

Permalink
ci: add support for ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommytrg committed Dec 5, 2024
1 parent 4818224 commit 3dc6ca0
Show file tree
Hide file tree
Showing 3 changed files with 16,672 additions and 13,463 deletions.
11 changes: 11 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
nodeLinker: node-modules
logFilters:
- code: YN0002
level: discard
- code: YN0013
level: discard
- code: YN0032
level: discard
- code: YN0060
level: discard
- code: YN0061
level: discard
33 changes: 23 additions & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM node:16-alpine3.15
FROM node:20-bookworm

ARG TARGETPLATFORM

# Install dependencies not included in the base image
RUN apk update
RUN apk upgrade
RUN apk --no-cache add bash ca-certificates curl
RUN apk add --no-cache git
RUN apk add --no-cache openssh-client
RUN apt update && apt upgrade -y
RUN apt install bash ca-certificates curl git openssh-client

# Update CA certificates
RUN update-ca-certificates
Expand All @@ -16,10 +15,24 @@ COPY . /data

# Navigate to the nodejs root package, install dependencies and build the project
WORKDIR /data
RUN corepack enable
RUN corepack prepare [email protected] --activate
RUN yarn
RUN yarn build
RUN corepack enable && corepack prepare [email protected] --activate

# Subroutine for arm64 platform
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
echo "Current platform linux/amd64"; \
yarn; \
yarn build; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
echo "Current platform linux/arm64"; \
apt install build-essential; \
yarn global add node-gyp; \
yarn; \
yarn build; \
else \
echo "Unsupported platform: $TARGETPLATFORM"; \
exit 1; \
fi

RUN chmod +x dist/bin/*

# Set the entrypoint and main command
Expand Down
Loading

0 comments on commit 3dc6ca0

Please sign in to comment.