Skip to content

Instantly share code, notes, and snippets.

@williamcroberts
Created February 10, 2021 16:20
Show Gist options
  • Save williamcroberts/3cbef7fd5c62409a6581408c7169fcb7 to your computer and use it in GitHub Desktop.
Save williamcroberts/3cbef7fd5c62409a6581408c7169fcb7 to your computer and use it in GitHub Desktop.
tss2-docker: examples and functions for running tpm2-software docker containers
#
# Source this file to get commands for launching containers like the tpm2-software CI system
# Example Usage:
# git clone https://github.com/tpm2-software/tpm2-tss.git
# cd tpm2-tss
# docker_run ubuntu-20.04
# Uses whatever arg1 is passed to it as container name. Useful for passing hashes from docker build results.
_docker_run() {
local b=$(basename $(pwd))
docker run --cap-add=SYS_PTRACE --ulimit core=0 -it --env-file .ci/docker.env -v "`pwd`:/workspace/$b" "$1" /bin/bash
}
# Looks for GitHub Container Registry (GHCR) images and runs them. The containers are availabe under the tpm2-software
# packages: https://github.com/orgs/tpm2-software/packages
docker_run() {
local r="ghcr.io/tpm2-software/${1:-ubuntu-16.04}"
_docker_run "$r"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment