-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile.x86_64
40 lines (32 loc) · 1.7 KB
/
Dockerfile.x86_64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM amazon/aws-lambda-nodejs:16 as builder
ARG DUCKDB_VERSION=1.1.3
ARG ARCHITECTURE=x86_64
# Install dependencies
RUN yum update -y && \
yum install git zip ninja-build make gcc-c++ openssl11-devel python-pip python3 -y && \
yum remove cmake -y && \
pip install cmake --upgrade
# Get DuckDB sources
RUN mkdir -p /tmp/from-git && \
cd /tmp/from-git && \
git clone --branch "main" https://github.com/duckdb/duckdb-node.git && \
cd duckdb-node && \
git fetch --all --tags && \
git checkout v${DUCKDB_VERSION}
# Configure
RUN cd /tmp/from-git/duckdb-node && npm i && STATIC_OPENSSL=1 CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) make
# Copy local binding definition
COPY src/lib/duckdb-binding.js /tmp/from-git/duckdb-node/lib/duckdb-binding.js
# Copy updated package.json
COPY src/package.json /tmp/from-git/duckdb-node/package.json
# Copy updated README.md
COPY src/README.md /tmp/from-git/duckdb-node/README.md
# Create zip file with layer contents
RUN mkdir -p /tmp/build/nodejs/node_modules/duckdb/lib /tmp/build/nodejs/node_modules/duckdb/release /tmp/release && \
cp /tmp/from-git/duckdb-node/lib/*.js /tmp/build/nodejs/node_modules/duckdb/lib && \
cp /tmp/from-git/duckdb-node/README.md /tmp/build/nodejs/node_modules/duckdb/README.md && \
cp /tmp/from-git/duckdb-node/package.json /tmp/build/nodejs/node_modules/duckdb/package.json && \
cp /tmp/from-git/duckdb-node/duckdb.js /tmp/build/nodejs/node_modules/duckdb/duckdb.js && \
cp /tmp/from-git/duckdb-node/build/Release/duckdb.node /tmp/build/nodejs/node_modules/duckdb/release/duckdb.node && \
cd /tmp/build/nodejs/node_modules/duckdb && npm version ${DUCKDB_VERSION} || true && \
cd /tmp/build && zip -q -r /tmp/release/duckdb-layer-${ARCHITECTURE}.zip .