mirror of
https://github.com/stefanberger/swtpm.git
synced 2025-08-22 10:30:52 +00:00

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>
38 lines
766 B
YAML
38 lines
766 B
YAML
---
|
|
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:
|