-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (30 loc) · 945 Bytes
/
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
# Rust version
FROM rust:1.83.0-slim-bookworm@sha256:d5e099796bcfe12393ed610f2e6f972cd6be4b87e137fc7d60424d0430698d80
# Set up environment
ENV CARGO_HOME="/usr/local/cargo"
ENV RUSTUP_HOME="/usr/local/rustup"
ENV CARGO_TARGET_DIR=/var/tmp/rust/target
# Provide the 'install_packages' helper script
COPY bin/install_packages.sh /usr/sbin/install_packages
# Install runtime dependencies
RUN install_packages \
ca-certificates \
gcc \
libclang-dev \
libtss2-dev \
pkg-config \
libjson-c-dev \
libssl-dev \
libcurl4-openssl-dev
# Install Rust components
RUN rustup component add rustfmt
# Copy 'rebuild' command
COPY bin/cargo-rebuild.sh /usr/local/cargo/bin/cargo-rebuild
# Copy entry-point script
COPY bin/entry-point.sh /opt/rust/entry-point.sh
# Copy example project
COPY src/example/ /var/opt/rust/src/
# Working directory
WORKDIR /var/opt/rust/src
# Entry point
ENTRYPOINT ["/opt/rust/entry-point.sh"]