forked from cargo-lambda/cargo-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (35 loc) · 1.4 KB
/
Dockerfile
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
41
ARG RUST_VERSION=1.66.0
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}
RUN set -eux; \
rustup toolchain install stable; \
rustup target install x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu;
CMD [ "cargo", "lambda" ]
ARG ZIG_VERSION=0.10.0
RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) zigArch='x86_64';; \
arm64) zigArch='aarch64';; \
esac; \
url="https://ziglang.org/download/${ZIG_VERSION}/zig-linux-${zigArch}-${ZIG_VERSION}.tar.xz"; \
wget "$url"; \
tar xf "zig-linux-${zigArch}-${ZIG_VERSION}.tar.xz"; \
mv zig-linux-${zigArch}-${ZIG_VERSION} zig; \
rm "zig-linux-${zigArch}-${ZIG_VERSION}.tar.xz"; \
mkdir /.cache; \
chmod a+w /.cache;
ENV PATH=$PATH:/zig
ARG CARGO_LAMBDA_VERSION=v0.14.0
RUN set -eux; \
mkdir cargo-lambda; \
cd cargo-lambda; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) lambdaArch='x86_64-unknown-linux-musl';; \
arm64) lambdaArch='aarch64-unknown-linux-musl';; \
esac; \
url="https://github.com/cargo-lambda/cargo-lambda/releases/download/${CARGO_LAMBDA_VERSION}/cargo-lambda-${CARGO_LAMBDA_VERSION}.${lambdaArch}.tar.gz"; \
wget "$url"; \
tar xf "cargo-lambda-${CARGO_LAMBDA_VERSION}.${lambdaArch}.tar.gz"; \
rm "cargo-lambda-${CARGO_LAMBDA_VERSION}.${lambdaArch}.tar.gz";
ENV PATH=$PATH:/cargo-lambda