mirror of
https://github.com/alibaba/higress.git
synced 2026-02-06 23:21:08 +08:00
Implement Rust Wasm Plugin Build & Publish Action (#1483)
This commit is contained in:
38
plugins/wasm-rust/DockerfileBuilder
Normal file
38
plugins/wasm-rust/DockerfileBuilder
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
ARG RUST_VERSION
|
||||
ARG ORAS_VERSION
|
||||
ARG HIGRESS_VERSION
|
||||
|
||||
ARG BASE_IMAGE=rust:${RUST_VERSION:-1.82}
|
||||
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 arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \
|
||||
rust_version=${RUST_VERSION:-1.82}; \
|
||||
oras_version=${ORAS_VERSION:-1.0.0}; \
|
||||
higress_version=${HIGRESS_VERSION:-1.0.0-rc}; \
|
||||
echo "arch: '$arch'"; \
|
||||
echo "rust rust_version: '$rust_version'"; \
|
||||
echo "oras_version: '$oras_version'"; \
|
||||
echo "higress_version: '$higress_version'"; \
|
||||
case "$arch" in \
|
||||
'amd64') \
|
||||
oras_url="https://github.com/oras-project/oras/releases/download/v$oras_version/oras_${oras_version}_linux_amd64.tar.gz"; \
|
||||
;; \
|
||||
'arm64') \
|
||||
oras_url="https://github.com/oras-project/oras/releases/download/v$oras_version/oras_${oras_version}_linux_arm64.tar.gz"; \
|
||||
;; \
|
||||
*) echo >&2 "error: unsupported architecture '$arch' "; exit 1 ;; \
|
||||
esac; \
|
||||
echo "oras_url: '$oras_url'"; \
|
||||
wget -O oras.tgz "$oras_url" --progress=dot:giga; \
|
||||
tar -C /usr/local/bin -xzf oras.tgz && rm -rf oras.tgz; \
|
||||
echo "done";
|
||||
|
||||
ENV PATH=$PATH:/usr/local/bin
|
||||
Reference in New Issue
Block a user