Skip to content
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

feat: supports custom prepare build script #1490

Merged
merged 7 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/wasm-rust/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM rust:1.80 as builder
WORKDIR /workspace
RUN apt update && apt-get install gcc gcc-multilib llvm clang -y && apt clean
RUN rustup target add wasm32-wasi
ARG PLUGIN_NAME="say-hello"
ARG BUILD_OPTS="--release"
ARG BUILDRC=".buildrc"
COPY . .
WORKDIR /workspace/extensions/$PLUGIN_NAME
RUN if [ -f $BUILDRC ]; then sh $BUILDRC; fi
RUN cargo build --target wasm32-wasi $BUILD_OPTS \
&& cp target/wasm32-wasi/release/*.wasm /main.wasm

Expand Down
5 changes: 1 addition & 4 deletions plugins/wasm-rust/DockerfileBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ FROM $BASE_IMAGE

LABEL rust_version=$RUST_VERSION oras_version=$ORAS_VERSION

RUN apt-get update \
&& apt-get install -y wget gcc gcc-multilib llvm clang \
&& rustup target add wasm32-wasi \
&& rm -rf /var/lib/apt/lists/*
RUN rustup target add wasm32-wasi

RUN arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \
rust_version=${RUST_VERSION:-1.82}; \
Expand Down
1 change: 1 addition & 0 deletions plugins/wasm-rust/extensions/ai-data-masking/.buildrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apt update && apt-get install gcc gcc-multilib llvm clang -y && apt clean
Loading