Skip to content

Commit

Permalink
Included the 'cargo-rebuild' command.
Browse files Browse the repository at this point in the history
  • Loading branch information
danieltrick committed Sep 20, 2024
1 parent e6d95b4 commit 75cfc06
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 40 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

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

## Unstable/Sid r4 - 2024-09-20

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

## Unstable/Sid r3 - 2024-09-10

### Added
Expand Down
52 changes: 13 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,34 @@
# Debian Version
ARG DEBIAN_VERS=debian:sid-20240904-slim

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Stage #1
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FROM $DEBIAN_VERS AS build
FROM debian:sid-20240904-slim

# Rust version
ARG RUST_VERSION=nightly-2024-09-10

# 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
ARG RUST_VERSION=nightly-2024-09-20

# 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/
COPY bin/install_packages.sh /usr/sbin/install_packages

# Install runtime dependencies
RUN install_packages \
ca-certificates \
curl \
gcc \
libclang-dev \
libtss2-dev \
pkg-config \
uuid-dev

# Copy Rust/Cargo files
COPY --from=build /opt/rust/ /opt/rust/
# 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

# 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,6 +12,6 @@ Version history

| **Release** | **Date** | **Base system** | **Rust toolchain** | **TPM2 Software Stack** |
| ----------- | ---------- | --------------------------------- | ------------------ | ----------------------- |
| r3 | 2024-09-10 | Debian Unstable (Sid), 2024-09-04 | 1.83.0-nightly | 4.1.3-1 |
| r4 | 2024-09-20 | Debian Unstable (Sid), 2024-09-04 | 1.83.0-nightly | 4.1.3-1 |
| r2 | 2024-09-05 | Debian Unstable (Sid), 2024-09-04 | 1.81.0 | 4.1.3-1 |
| r1 | 2024-09-03 | Debian Unstable (Sid), 2024-08-13 | 1.80.0 | 4.1.3-1 |
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 75cfc06

Please sign in to comment.