-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.cross
More file actions
20 lines (16 loc) · 771 Bytes
/
Dockerfile.cross
File metadata and controls
20 lines (16 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Dockerfile for cross-compiling from aarch64 (host) to amd64 (target)
FROM rust:slim-bookworm
RUN dpkg --add-architecture amd64 \
&& apt-get update -qq \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends protobuf-compiler libprotobuf-dev pkg-config git libssl-dev:amd64 gcc-x86-64-linux-gnu g++-x86-64-linux-gnu \
&& rm -rf /var/lib/apt/lists/*
RUN rustup target add x86_64-unknown-linux-gnu
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc
ENV CC=x86_64-linux-gnu-gcc
ENV PKG_CONFIG_ALLOW_CROSS=1
ENV OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
ENV OPENSSL_INCLUDE_DIR=/usr/include
WORKDIR /workspace
ENTRYPOINT ["cargo", "build", "--release", "--target=x86_64-unknown-linux-gnu"]
CMD ["--bin", "objectstore"]