File tree Expand file tree Collapse file tree 5 files changed +59
-31
lines changed Expand file tree Collapse file tree 5 files changed +59
-31
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,11 @@ ENV PATH=$PATH:/nodejs/bin
11
11
WORKDIR /mongodb-client-encryption
12
12
COPY . .
13
13
14
- RUN apt-get -qq update && apt-get -qq install -y python3 build-essential git && ldd --version
14
+ RUN apt-get -qq update && apt-get -qq install -y build-essential curl git && ldd --version
15
15
16
- RUN npm run install:libmongocrypt
17
-
18
- ARG RUN_TEST
19
- RUN if [ -n "$RUN_TEST" ]; then npm test ; else echo "skipping tests" ; fi
20
-
21
- FROM scratch
22
-
23
- COPY --from=build /mongodb-client-encryption/prebuilds/ /
16
+ RUN bash install-pyenv.sh
17
+ RUN pyenv install 3.10 && pyenv global 3.10
18
+ RUN python --version
19
+ RUN git --version
20
+ RUN c++ --version
21
+ RUN g++ --version
Original file line number Diff line number Diff line change 1
- ARG PLATFORM =arm64
1
+ ARG ARCH =arm64
2
2
ARG NODE_VERSION=16.20.1
3
3
4
- FROM ${PLATFORM}/node:${NODE_VERSION}-alpine AS build
5
-
6
- WORKDIR /mongodb-client-encryption
7
- COPY . .
4
+ FROM ${ARCH}/node:${NODE_VERSION}-alpine AS dependencies
8
5
9
6
RUN apk --no-cache add make g++ libc-dev curl bash python3 py3-pip cmake git
10
- RUN npm run install:libmongocrypt
11
- RUN npm run prebuild
12
-
13
- ARG RUN_TEST
14
- RUN if [ -n "$RUN_TEST" ]; then npm test ; else echo "skipping tests" ; fi
15
-
16
- FROM scratch
17
7
18
- COPY --from=build /mongodb-client-encryption/prebuilds/ /
8
+ RUN python3 --version
9
+ RUN git --version
10
+ RUN c++ --version
11
+ RUN g++ --version
Original file line number Diff line number Diff line change
1
+ ARG ARCH
2
+ ARG NODE_VERSION
3
+ FROM ${ARCH}-alpine-base-node-${NODE_VERSION}:latest
4
+
5
+ WORKDIR /mongodb-client-encryption
6
+ COPY . .
7
+
8
+ RUN npm install --ignore-scripts
9
+ RUN npm run install:libmongocrypt -- --skip-bindings
Original file line number Diff line number Diff line change @@ -109,14 +109,29 @@ jobs:
109
109
version : v0.18.0
110
110
driver-opts : image=moby/buildkit:v0.17.2
111
111
112
+ - name : Init builder
113
+ run : docker buildx create --name builder --bootstrap --use
114
+
112
115
- name : Run Buildx
113
116
run : |
114
- docker buildx create --name builder --bootstrap --use
117
+ ARCH=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}
118
+ NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}
119
+ TAG=$ARCH-alpine-lib-base-node-$NODE_VERSION
115
120
docker --debug buildx build --progress=plain --no-cache \
116
121
--platform linux/${{ matrix.linux_arch }} \
117
- --build-arg="PLATFORM=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }} " \
122
+ --build-arg="ARCH=$ARCH " \
118
123
--build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \
119
- --build-arg="RUN_TEST=true" \
120
- --output type=local,dest=./prebuilds,platform-split=false \
124
+ --output type=oci,dest=alpine-node-base,platform-split=false \
121
125
-f ./.github/docker/Dockerfile.musl \
122
- .
126
+ -t $ARCH-alpine-lib-base-node-$NODE_VERSION
127
+ .
128
+
129
+ - id : upload
130
+ name : Upload prebuild
131
+ uses : actions/upload-artifact@v4
132
+ with :
133
+ name : ${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}-alpine-lib-base-node-${{ steps.get_nodejs_version.outputs.version }}
134
+ path : alpine-node-base
135
+ if-no-files-found : ' error'
136
+ retention-days : 30
137
+ compression-level : 0
Original file line number Diff line number Diff line change @@ -13,15 +13,28 @@ NODE_VERSION=20.0.0
13
13
SCRIPT_DIR=$( dirname ${BASH_SOURCE:- $0 } )
14
14
PROJECT_DIR=$SCRIPT_DIR /..
15
15
16
+ # set -o xtrace
17
+
16
18
build_and_test_musl () {
17
19
docker buildx create --name builder --bootstrap --use
18
20
19
- docker --debug buildx build --load --progress=plain --no-cache \
20
- --platform linux/$LINUX_ARCH --output=type=docker \
21
+ BASE_TAG=$LINUX_ARCH -alpine-base-node-$NODE_VERSION
22
+ docker --debug buildx build --progress=plain \
23
+ --platform linux/$LINUX_ARCH --output=type=oci,dest=alpine-lib-base \
21
24
--build-arg=" PLATFORM=$LINUX_ARCH " \
22
25
--build-arg=" NODE_VERSION=$NODE_VERSION " \
23
26
--build-arg=" RUN_TEST=true" \
24
- -f ./.github/docker/Dockerfile.musl -t musl-zstd-base \
27
+ -f ./.github/docker/Dockerfile.musl -t $BASE_TAG \
28
+ .
29
+
30
+ cat alpine-lib-base | docker load
31
+
32
+ LIBMONGOCRYPT_TAG=$LINUX_ARCH -alpine-libmongocrypt-node-$NODE_VERSION
33
+ docker --debug buildx build --progress=plain --pull=false --no-cache \
34
+ --platform linux/$LINUX_ARCH --load \
35
+ --build-arg=" ARCH=$LINUX_ARCH " \
36
+ --build-arg=" NODE_VERSION=$NODE_VERSION " \
37
+ -f ./.github/docker/Test.dockerfile -t $LIBMONGOCRYPT_TAG \
25
38
.
26
39
}
27
40
@@ -42,5 +55,5 @@ build_and_test_glibc() {
42
55
$PROJECT_DIR
43
56
}
44
57
45
- build_and_test_musl
58
+ # build_and_test_musl
46
59
# build_and_test_glibc
You can’t perform that action at this time.
0 commit comments