Skip to content

Commit e931ff1

Browse files
authored
Merge pull request #2036 from tlaurion/bugfix-qemu_kvm
docker_*.sh: add kvm support, X11 authentication, update README.md instructions. Bump docker image to v.0.2.7 with pinned hash under CircleCI. Also fixes things tested in dev cycles: - DO_WITH_DEBUG calls to tpm increment (was preventing TPM password prompt output. - Adds wait_for_sub_devices function to poll for detection of usb devices before testing gpg --card-status
2 parents 81dbf23 + 699a1a7 commit e931ff1

17 files changed

+2726
-274
lines changed

.circleci/config.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ commands:
4848
jobs:
4949
prep_env:
5050
docker:
51-
- image: tlaurion/heads-dev-env:v0.2.5
51+
# Docker image: tlaurion/heads-dev-env:v0.2.7
52+
- image: tlaurion/heads-dev-env@sha256:5f890f3d1b6b57f9e567191695df003a2ee880f084f5dfe7a5633e3e8f937479
5253
resource_class: large
5354
working_directory: ~/heads
5455
steps:
@@ -123,7 +124,8 @@ jobs:
123124

124125
build_and_persist:
125126
docker:
126-
- image: tlaurion/heads-dev-env:v0.2.5
127+
# Docker image: tlaurion/heads-dev-env:v0.2.7
128+
- image: tlaurion/heads-dev-env@sha256:5f890f3d1b6b57f9e567191695df003a2ee880f084f5dfe7a5633e3e8f937479
127129
resource_class: large
128130
working_directory: ~/heads
129131
parameters:
@@ -151,7 +153,8 @@ jobs:
151153

152154
build:
153155
docker:
154-
- image: tlaurion/heads-dev-env:v0.2.5
156+
# Docker image: tlaurion/heads-dev-env:v0.2.7
157+
- image: tlaurion/heads-dev-env@sha256:5f890f3d1b6b57f9e567191695df003a2ee880f084f5dfe7a5633e3e8f937479
155158
resource_class: large
156159
working_directory: ~/heads
157160
parameters:
@@ -172,7 +175,8 @@ jobs:
172175

173176
save_cache:
174177
docker:
175-
- image: tlaurion/heads-dev-env:v0.2.5
178+
# Docker image: tlaurion/heads-dev-env:v0.2.7
179+
- image: tlaurion/heads-dev-env@sha256:5f890f3d1b6b57f9e567191695df003a2ee880f084f5dfe7a5633e3e8f937479
176180
resource_class: large
177181
working_directory: ~/heads
178182
steps:

README.md

Lines changed: 468 additions & 37 deletions
Large diffs are not rendered by default.

docker/DOCKER_REPRO_DIGEST

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Optional: pin the Docker image used by ./docker_repro.sh to an immutable digest
2+
# This file is read by docker_repro.sh if DOCKER_REPRO_DIGEST is not set in the
3+
# environment. The first non-empty, non-comment line is used as the digest value.
4+
# Acceptable formats are:
5+
# - sha256:<64-hex>
6+
# - sha256-<64-hex> (will be normalized to sha256:<hex>)
7+
# - <64-hex> (will be normalized to sha256:<hex>)
8+
# Example:
9+
# sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
10+
11+
# Place the digest on the first non-comment line below (remove the leading '#')
12+
# Version: v0.2.7
13+
sha256:5f890f3d1b6b57f9e567191695df003a2ee880f084f5dfe7a5633e3e8f937479

docker/check_reproducibility.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
# Helper to compare local Docker image digest with remote docker.io
3+
# Usage: ./docker/check_reproducibility.sh [local_image] [remote_image]
4+
# Example:
5+
# ./docker/check_reproducibility.sh linuxboot/heads:dev-env tlaurion/heads-dev-env:latest
6+
7+
set -euo pipefail
8+
9+
usage() {
10+
cat <<'USAGE' >&2
11+
Usage: $0 [local_image] [remote_image]
12+
13+
Compare a local Docker image digest with a remote docker.io image.
14+
15+
Arguments:
16+
local_image Local image to check (default: linuxboot/heads:dev-env)
17+
remote_image Remote docker.io image to compare against (default: ${HEADS_MAINTAINER_DOCKER_IMAGE}:latest, where HEADS_MAINTAINER_DOCKER_IMAGE defaults to tlaurion/heads-dev-env)
18+
19+
Environment:
20+
HEADS_MAINTAINER_DOCKER_IMAGE Override the canonical maintainer's image repository (default: tlaurion/heads-dev-env)
21+
22+
Examples:
23+
./docker/check_reproducibility.sh
24+
./docker/check_reproducibility.sh linuxboot/heads:dev-env tlaurion/heads-dev-env:latest
25+
./docker/check_reproducibility.sh linuxboot/heads:dev-env tlaurion/heads-dev-env:v0.2.7
26+
HEADS_MAINTAINER_DOCKER_IMAGE="myuser/heads-dev-env" ./docker/check_reproducibility.sh
27+
28+
Requirements:
29+
- docker CLI (required; to inspect local images and perform pulls)
30+
- Recommended (optional): `skopeo` (preferred for manifest inspection without pulling), `jq` + `curl` (fallback to query Docker Hub API). If these are missing the script will fall back to `docker pull` which may download large image layers.
31+
- Network access (to pull remote images or query registries)
32+
33+
USAGE
34+
}
35+
36+
if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
37+
usage
38+
exit 0
39+
fi
40+
41+
echo "=== Docker Image Reproducibility Check ===" >&2
42+
# Source shared helpers and delegate to centralized reproducibility checker
43+
# shellcheck source=docker/common.sh
44+
source "$(dirname "$0")/common.sh"
45+
# Ensure docker is available
46+
require_docker || exit $?
47+
# Resolve local and remote images (remote uses shared defaulting logic)
48+
local_image="${1:-linuxboot/heads:dev-env}"
49+
remote_image=$(resolve_repro_remote_image "${2:-}")
50+
# Delegate to the refactored checker which prefers image ID / config digest comparison
51+
compare_image_reproducibility "${local_image}" "${remote_image}"
52+
exit $?
53+

0 commit comments

Comments
 (0)