Skip to content

Commit

Permalink
Switched base system from 'debian:12.7-slim' to 'rust:1.*-slim-bookwo…
Browse files Browse the repository at this point in the history
…rm'.
  • Loading branch information
danieltrick committed Sep 20, 2024
1 parent 0575990 commit 99a9912
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 44 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/).

## r7 - 2024-09-20

### Changed
- Switched base system from `debian:12.7-slim` to `rust:1.*-slim-bookworm`.

### Added
- Included the `cargo-rebuild` command.

## r6 - 2024-09-10

### Added
Expand Down
57 changes: 14 additions & 43 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,59 +1,30 @@
# Debian Version
ARG DEBIAN_VERS=debian:12.7-slim

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Stage #1
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FROM $DEBIAN_VERS AS build

# Rust version
ARG RUST_VERSION=1.81.0

# Set up environment
ENV RUSTUP_HOME=/opt/rust/rustup
ENV CARGO_HOME=/opt/rust/cargo

# Provide the 'install_packages' tool
COPY src/install_packages.sh /usr/sbin/install_packages

# Install build dependencies
RUN install_packages \
ca-certificates \
curl \
rdfind

# Install Rust
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- --default-toolchain=${RUST_VERSION} --profile=minimal -y \
&& ${CARGO_HOME}/bin/rustup component add rustfmt \
&& rdfind -makeresultsfile false -makesymlinks true /opt/rust/

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Stage #2
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FROM $DEBIAN_VERS
FROM rust:1.81-slim-bookworm

# Set up environment
ENV RUSTUP_HOME=/opt/rust/rustup
ENV CARGO_HOME=/opt/rust/cargo
ENV CARGO_HOME="/usr/local/cargo"
ENV RUSTUP_HOME="/usr/local/rustup"
ENV CARGO_TARGET_DIR=/var/tmp/rust/target

# Provide the 'install_packages' tool
COPY --from=build /usr/sbin/install_packages /usr/sbin/

# Copy Rust/Cargo files
COPY --from=build /opt/rust/ /opt/rust/
# 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
pkg-config \
libjson-c-dev \
libssl-dev \
libcurl4-openssl-dev

# Install Rust components
RUN rustup component add rustfmt

# Copy Rust/Cargo files
COPY --from=build /opt/rust/ /opt/rust/
# 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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Version history

| **Release** | **Date** | **Base system** | **Rust toolchain** | **TPM2 Software Stack** |
| ----------- | ---------- | ------------------------------ | ------------------ | ----------------------- |
| r6 | 2024-09-10 | Debian 12.7, 2024-09-05 | 1.81.0 | 3.2.1-3 |
| r7 | 2024-09-20 | Debian 12.7, 2024-09-05 | 1.81.0 | 3.2.1-3 |
| r5 | 2024-09-05 | Minideb "Bookworm", 2024-08-31 | 1.81.0 | 3.2.1-3 |
| r4 | 2024-08-31 | Minideb "Bookworm", 2024-08-31 | 1.80.0 | 3.2.1-3 |
| r3 | 2024-08-30 | Debian 12, 2024-08-12 | 1.80.0 | 3.2.1-3 |
3 changes: 3 additions & 0 deletions bin/cargo-rebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash -ex
cargo clean
cargo build "${@:2}"
File renamed without changes.

0 comments on commit 99a9912

Please sign in to comment.