FROM ghcr.io/tpm2-software/ubuntu-22.04:latest # Install Rust toolchain RUN curl https://sh.rustup.rs -sSf | bash -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" RUN apt-get update -y -qq && \ apt-get install --assume-yes --no-install-recommends \ ca-certificates \ clang \ emacs \ libclang-dev \ libsofthsm2 \ libsqlite3-dev \ libssl-dev \ nettle-dev \ make \ org-mode \ pkg-config \ libtss2-dev \ tpm2-tools \ && \ apt-get clean COPY Cargo.toml Cargo.lock /app/ COPY tools /app/tools WORKDIR /app RUN mkdir .cargo RUN mkdir src RUN touch src/main.rs RUN cargo vendor > .cargo/config COPY src /app/src RUN rm src/main.rs RUN cargo build -p sequoia-tpm-tools COPY README.org /app/ RUN emacs -Q --batch --eval " \ (progn \ (require 'ob-tangle) \ (dolist (file command-line-args-left) \ (with-current-buffer (find-file-noselect file) \ (org-babel-tangle))))" README.org RUN /bin/bash -x ./README.sh RUN cargo test RUN cargo clippy -- -A clippy::style -A clippy::complexity