tr4mpass/Dockerfile
debian e3ecb9e14c build: drop the in-container usbmuxd and document the USB limits
usbmuxd inside the image competes with the host daemon for the device and is not mounted anyway. Add a .dockerignore so the build context does not carry host objects, and document that the binary links against trixie libraries and therefore is not meant to be copied out, plus the rootful/udev requirement for USB access.
2026-11-29 12:47:21 -03:00

32 lines
1.3 KiB
Docker

# syntax=docker/dockerfile:1
# Reproducible build of tr4mpass with every dependency inside the image, so
# nothing gets installed on the host. Debian trixie matches the development
# host. The binary links against trixie's shared libraries, so it is meant to
# run inside this image, not to be copied out: on another machine it will fail
# with "cannot open shared object file".
FROM debian:trixie-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential pkg-config \
libimobiledevice-dev libirecovery-1.0-dev libusb-1.0-0-dev libplist-dev \
libssl-dev libcurl4-openssl-dev libssh2-1-dev \
usbutils \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Only what make needs: the Makefile, src/, include/ and tests/ (the
# .chip-db-canary target depends on tests/chip_db_canary.c).
COPY Makefile ./
COPY src ./src
COPY include ./include
COPY tests ./tests
RUN make clean && make
# The binary ends up at /build/tr4mpass. Running it needs the real USB bus:
# podman run --rm -it --device-cgroup-rule='c 189:* rwm' \
# -v /dev/bus/usb:/dev/bus/usb tr4mpass ./tr4mpass -v
# 189 is the USB major. Rootless podman cannot open those nodes (they are
# root:root 0664), so running needs rootful podman or a udev rule on the host.
CMD ["/bin/bash"]