-
Notifications
You must be signed in to change notification settings - Fork 3
feat(NODE-6727): Add builds on Alpine linux #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG PLATFORM=arm64 | ||
ARG NODE_VERSION=16.20.1 | ||
|
||
FROM ${PLATFORM}/node:${NODE_VERSION}-alpine AS build | ||
|
||
WORKDIR /mongodb-client-encryption | ||
COPY . . | ||
|
||
RUN apk --no-cache add make g++ libc-dev curl bash python3 py3-pip vim cmake git | ||
nbbeeken marked this conversation as resolved.
Show resolved
Hide resolved
|
||
RUN npm run install:libmongocrypt | ||
RUN npm run prebuild | ||
|
||
ARG RUN_TEST | ||
RUN if [ -n "$RUN_TEST" ]; then npm test ; else echo "skipping tests" ; fi | ||
|
||
FROM scratch | ||
|
||
COPY --from=build /mongodb-client-encryption/prebuilds/ / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#! /bin/bash | ||
|
||
# script to aid in local testing of linux platforms | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm happy to remove this, but I find this immensely useful when working on ubuntu or alpine builds locally. We have this script in our zstd repo. |
||
# requires a running docker instance | ||
|
||
# s390x, arm64, amd64 for ubuntu | ||
# amd64 or arm64v8 for alpine | ||
LINUX_ARCH=amd64 | ||
|
||
# 16.20.1+, default 16.20.1 | ||
NODE_VERSION=20.0.0 | ||
|
||
SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0}) | ||
PROJECT_DIR=$SCRIPT_DIR/.. | ||
|
||
build_and_test_musl() { | ||
docker buildx create --name builder --bootstrap --use | ||
|
||
docker --debug buildx build --load --progress=plain --no-cache \ | ||
--platform linux/$LINUX_ARCH --output=type=docker \ | ||
--build-arg="PLATFORM=$LINUX_ARCH" \ | ||
--build-arg="NODE_VERSION=$NODE_VERSION" \ | ||
--build-arg="RUN_TEST=true" \ | ||
-f ./.github/docker/Dockerfile.musl -t musl-zstd-base \ | ||
. | ||
} | ||
|
||
build_and_test_glibc() { | ||
docker buildx create --name builder --bootstrap --use | ||
|
||
UBUNTU_VERSION=$(node --print 'Number(process.argv[1].split(`.`).at(0)) > 16 ? `noble` : `bionic`' $NODE_VERSION) | ||
NODE_ARCH=$(node -p 'process.argv[1] === `amd64` && `x64` || process.argv[1]' $LINUX_ARCH) | ||
echo $UBUNTU_VERSION | ||
docker buildx build --progress=plain --no-cache \ | ||
--platform linux/$LINUX_ARCH \ | ||
--build-arg="NODE_ARCH=$NODE_ARCH" \ | ||
--build-arg="NODE_VERSION=$NODE_VERSION" \ | ||
--build-arg="UBUNTU_VERSION=$UBUNTU_VERSION" \ | ||
--build-arg="RUN_TEST=true" \ | ||
--output type=local,dest=./prebuilds,platform-split=false \ | ||
-f ./.github/docker/Dockerfile.glibc \ | ||
$PROJECT_DIR | ||
} | ||
|
||
build_and_test_musl | ||
# build_and_test_glibc |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.