11FROM ubuntu:22.04 AS build_sdk
22
3- ARG PG_VERSION
4- ARG SDK_VERSION
3+ ARG PG_VERSION=16.4
4+ ARG SDK_VERSION=3.1.74.3bi
55ARG DEBUG=false
66ARG OBJDUMP=true
77
1212 SYS_PYTHON=/usr/bin/python3 \
1313 DEBUG=$DEBUG \
1414 BUILDS=3.12 \
15- EMFLAVOUR=latest
15+ EMFLAVOUR=3.1.74
1616
1717WORKDIR /workspace
1818
@@ -26,53 +26,43 @@ RUN \
2626 make build-essential wget lz4 bzip2 pv curl
2727
2828# Download the python-wasm-sdk source for the given version
29- RUN git clone --depth 1 --branch ${SDK_VERSION} https://github.com/pygame-web/python-wasm-sdk.git
29+ # RUN git clone --depth 1 --branch ${SDK_VERSION} https://github.com/pygame-web/python-wasm-sdk.git
30+ RUN git clone --depth 1 https://github.com/electric-sql/portable-sdk.git
3031
31- # Remove third party libraries that are not necessary for PGLite
32- RUN cd ./python-wasm-sdk/sources.wasm && rm assimp.sh bullet3.sh ode.sh
32+ WORKDIR /workspace/portable-sdk/python-wasm-sdk
3333
3434# Make python-wasm-sdk
35- RUN cd ./python-wasm-sdk && chmod +x ./ python-wasm-sdk.sh && bash -c "./python-wasm-sdk.sh"
35+ RUN chmod +x python-wasm-sdk.sh
3636
37+ RUN bash -c "./python-wasm-sdk.sh"
3738
3839FROM ubuntu:22.04
3940
40- ARG PG_VERSION
41- ARG SDK_VERSION
41+ # Install dependencies to build postgres wasm
42+ RUN \
43+ apt-get update &&\
44+ apt-get install -y lz4 wget pv bash bzip2 python3 build-essential libreadline-dev zlib1g-dev bison flex &&\
45+ apt-get clean
46+
47+ ARG PG_VERSION=16.4
48+ ARG SDK_VERSION=3.1.74.3bi
4249ARG DEBUG=false
4350ARG OBJDUMP=true
4451
4552ENV \
4653 PG_VERSION=$PG_VERSION \
4754 SDK_VERSION=$SDK_VERSION \
48- SDK_ARCHIVE=python3.12-wasm-sdk-Ubuntu-22.04.tar \
55+ SDK_ARCHIVE=python3.12-wasm-sdk-Ubuntu-22.04.tar.lz4 \
4956 SDKROOT=/opt/python-wasm-sdk \
5057 SYS_PYTHON=/usr/bin/python3 \
5158 PGROOT=/tmp/pglite \
5259 DEBUG=$DEBUG \
5360 OBJDUMP=$OBJDUMP
5461
55- WORKDIR /workspace
56-
57- COPY --from=0 /tmp/sdk /tmp/sdk
58-
59- ENV SDK_VERSION=3.1.74.2bi
60- ENV WASI_SDK_VERSION=24.0.5
61- ENV SDK_ARCHIVE=python3.13-wasm-sdk-Ubuntu-22.04.tar.lz4
62- ENV WASI_SDK_ARCHIVE=python3.13-wasi-sdk-Ubuntu-22.04.tar.lz4
63-
64- # Install dependencies to build postgres wasm
65- RUN \
66- apt-get update &&\
67- apt-get install -y lz4 wget pv bash curl bzip2 python3 build-essential libreadline-dev zlib1g-dev bison flex git curl &&\
68- apt-get clean
69-
70- RUN curl -sL --retry 5 https://github.com/pygame-web/python-wasm-sdk/releases/download/$SDK_VERSION/$SDK_ARCHIVE | tar xvP --use-compress-program=lz4 | pv -p -l -s 46000 >/dev/null
71- RUN curl -sL --retry 5 https://github.com/pygame-web/python-wasi-sdk/releases/download/$WASI_SDK_VERSION/$WASI_SDK_ARCHIVE | tar xvP --use-compress-program=lz4 | pv -p -l -s 23000 >/dev/null
62+ COPY --from=build_sdk /tmp/sdk /tmp/sdk
7263
73- # Extract SDK
74- RUN cd / && tar xvf /tmp/sdk/${SDK_ARCHIVE} | pv -p -l -s 24400 >/dev/null
64+ RUN tar --use-compress-program=lz4 -xvf /tmp/sdk/${SDK_ARCHIVE} -C /
7565
76- # Clean up packaged SDK
77- RUN rm -rf /tmp/sdk
66+ RUN rm -r /tmp/sdk
7867
68+ WORKDIR /workspace
0 commit comments