swtpm/docker-compose.yml
Boris Glimcher 4135ee7e5b ci: add testing via docker compose
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>
2024-07-18 16:48:21 -04:00

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: