-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto testing as well as good example on: how to run SWTPM in docker or compose. Simply run `docker-compose up` to bring both swtpm and test. Or run `docker-compose up --build --force-recreate` to re-build. Or run `docker-compose up swtpm` to only start swtpm service without test. Added new job in the github action to automate this as well. Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
version: '3.7' | ||
|
||
services: | ||
|
||
swtpm: | ||
build: | ||
context: . | ||
volumes: | ||
- tpm-data:/swtpm | ||
networks: | ||
- swtpm | ||
command: ['socket', '--tpm2', | ||
'--server', 'type=unixio,path=/swtpm/swtpm.sock', | ||
'--ctrl', 'type=unixio,path=/swtpm/swtpm.sock.ctrl', | ||
'--tpmstate', 'dir=/swtpm', | ||
'--log', 'file=swtpm.log', | ||
'--log', 'level=20', | ||
'--flags', 'not-need-init,startup-clear'] | ||
|
||
swtpm-test: | ||
image: docker.io/strongx509/tpm:5.9.13 | ||
depends_on: | ||
- swtpm | ||
volumes: | ||
- tpm-data:/swtpm | ||
networks: | ||
- swtpm | ||
environment: | ||
TPM2TOOLS_TCTI: swtpm:path=/swtpm/swtpm.sock | ||
command: ['tpm2', 'clear'] | ||
|
||
volumes: | ||
tpm-data: | ||
|
||
networks: | ||
swtpm: |