From 592cb66a756a38ccb2255b871f21c48806e97695 Mon Sep 17 00:00:00 2001 From: Daniel Trick Date: Thu, 21 Nov 2024 19:02:59 +0100 Subject: [PATCH] Force line-buffering for 'tpm2-simulator' process, so that its text output will be visible. --- .github/workflows/docker-publish.yml | 6 +++--- Dockerfile | 5 ++++- README.md | 8 ++++---- bin/entrypoint.sh | 3 +++ 4 files changed, 14 insertions(+), 8 deletions(-) create mode 100755 bin/entrypoint.sh diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f8872e9..885c530 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -27,7 +27,7 @@ jobs: id: meta uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - images: danieltrick/ms-tpm2sim-docker + images: danieltrick/mssim-docker - name: Build and push Docker image id: push @@ -47,8 +47,8 @@ jobs: steps: - name: Pull and save the Docker image run: | - docker image pull danieltrick/ms-tpm2sim-docker:${{ github.ref_name }} - docker image save danieltrick/ms-tpm2sim-docker:${{ github.ref_name }} | xz -9v > mssim_docker-${{ github.ref_name }}.tar.xz + docker image pull danieltrick/mssim-docker:${{ github.ref_name }} + docker image save danieltrick/mssim-docker:${{ github.ref_name }} | xz -9v > mssim_docker-${{ github.ref_name }}.tar.xz - name: Upload image to GitHub release uses: Roang-zero1/github-upload-release-artifacts-action@v2 diff --git a/Dockerfile b/Dockerfile index 3d84bae..fb47bd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,6 +50,9 @@ RUN install_packages \ # Copy the built binaries COPY --from=build /opt/mssim/bin/tpm2-simulator /usr/bin/ +# Copy startup script +COPY bin/entrypoint.sh /opt/ + # Start TPM simulator -ENTRYPOINT ["/usr/bin/tpm2-simulator"] +ENTRYPOINT ["/opt/entrypoint.sh"] CMD ["2321"] diff --git a/README.md b/README.md index b5f9252..3ab57fc 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ MS TPM 2.0 Simulator Docker The purpose of this repository is to provide ready to use Docker images of [ms-tpm-20-ref](https://github.com/microsoft/ms-tpm-20-ref). **Docker Hub page:** - + Version history --------------- -| **Release** | **Date** | **Base system** | **TPM Simulator Version** | **Commit** | -| ------------| ---------- | --------------------- | ------------------------- |--------------------------------------------------------------------------------- | -| r1 | 2024-11-21 | Debian 12, 2024-11-11 | 1.62.0 | [`ee21db0a941d`](https://github.com/microsoft/ms-tpm-20-ref/commit/ee21db0a941d) | +| **Release** | **Date** | **Base system** | **TPM Simulator Version** | **Commit** | +| ------------| ---------- | --------------------- | ------------------------- |---------------------------------------------------------------------------------------------- | +| r1 | 2024-11-21 | Debian 12, 2024-11-11 | 1.62.0 | [`ee21db0a941d`](https://github.com/microsoft/ms-tpm-20-ref/commit/ee21db0a941d) (2024-10-04) | diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh new file mode 100755 index 0000000..36913dd --- /dev/null +++ b/bin/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh +set -ex +stdbuf -oL -eL /usr/bin/tpm2-simulator "$@"