autopkgtest-virt-docker(1)
π autopkgtest-virt-docker β the manual page, bestie edition
okay so this is a General Commands Manual page (iykyk) for autopkgtest-virt-docker and its twin autopkgtest-virt-podman. It's giving "let me run your autopkgtest inside a container" and honestly? iconic. β¨
π¦ NAME π¦
autopkgtest-virt-docker, autopkgtest-virt-podman β the autopkgtest virtualisation server that runs on Docker/Podman π³
πΈ SYNOPSIS πΈ
autopkgtest-virt-docker [options] docker-image [-- extra docker-run args...]
autopkgtest-virt-podman [options] podman-image [-- extra podman-run args...]
β¨ DESCRIPTION β¨
So autopkgtest-virt-docker is literally an autopkgtest virtualization server, and it works with Docker or Podman. No cap. It takes everything the docker(1) or podman(1) command line can do and adapts it so autopkgtest can use it. π«Ά
Normally, bestie, you're not the one calling autopkgtest-virt-docker β autopkgtest invokes it for you. Main character energy, but off-screen. π
π₯ HOST REQUIREMENTS π₯
When you run this as autopkgtest-virt-podman, or with the --podman option (which is recommended, fr fr), this virtualization server needs podman(1) from the podman package. Also:
- Unprivileged access to user namespaces has to be enabled β and yes, that's the default in Debian 11 or later, slay π
- The current user must have at least 65536 subordinate user IDs allocated in
/etc/subuid - And 65536 subordinate group IDs in
/etc/subgid
For the whole tea, go read /usr/share/doc/podman/README.Debian. π
When you run it as autopkgtest-virt-docker, or with the --docker option, it needs docker(1) from the docker.io package. The current user must have access to the Docker daemon socket /run/docker.sock, unless you use the --sudo option.
β οΈ heads up bestie: either of those two things makes the user root-equivalent on the host system. That's a whole lot of power. Using Podman instead of Docker is recommended. π
π IMAGE REQUIREMENTS π
The image must contain apt(8) with a suitable configuration. Non-negotiable.
The image should either provide the useradd(8) program β that's part of the passwd package, which is Priority: required β or it should already have an unprivileged user pre-created in the uid range 1000 to 59999. Pick your lane. β¨
When using Podman, if the image contains an init system, it should be labelled with something like:
LABEL org.debian.autopkgtest.init=systemd
This is the glow-up that lets autopkgtest-virt-podman detect the init system automatically, so you don't have to specify the --init option yourself. Commands like autopkgtest-build-podman --init=systemd add a suitable label for you, but you can totally do it manually for images that were created differently. π
The known values used by autopkgtest-build-podman(1) are none, systemd, sysv-rc and openrc. But here's the vibe check: any non-empty value except for none is assumed to mean that /sbin/init will be present and functional. π
π OPTIONS π
--dockerβ Use Docker containers and the Docker container manager. This is the default when invoked asautopkgtest-virt-docker. π³--podmanβ Use Podman containers and the Podman container manager. This is the default when invoked asautopkgtest-virt-podman. π¦-d|--debugβ Enables debugging output. Turn it on when you need to see what's actually happening, bestie. π--initβ Launches the container by running/sbin/initas the initial command. When using Podman, the default is to use the init system if the image has been labelled as containing one β see the "Image Requirements" section above, go look, I'll wait. π This option is unlikely to work when using Docker.
When using systemd(1) as init, note that some of the execution environment options described in systemd.exec(5) require the container to have CAP_SYS_ADMIN, and that has unclear security implications: it certainly reduces hardening between the host and the container, and it might be sufficient to allow code that runs as root in the container to compromise processes outside the container that are running under the same uid as autopkgtest-virt-podman β for example by unmounting filesystems that are used to "mask" security-sensitive parts of /proc and /sys. π
If this is consistent with your security model, it can be allowed by passing the --cap-add=CAP_SYS_ADMIN option to podman-run(1):
autopkgtest ... -- podman --init $IMAGE -- --cap-add=CAP_SYS_ADMIN
--no-initβ Launches the container by runningsleep infinityas the initial command. This is the default for Docker, and for Podman images that haveLABEL org.debian.autopkgtest.init=noneor noorg.debian.autopkgtest.initlabel at all. When this option is used, the image will not be able to provide theisolation-containerautopkgtest capability. π-p|--pullβ Pulls the specified image before setting up the container. By default the image is expected to already be present. π₯-s|--sudoβ Run Docker or Podman commands throughsudo. For Podman, this is rarely useful, because Podman usually runs unprivileged. For Docker, use this option if you run autopkgtest as a normal user who does not have access to the docker daemon β i.e. you're not a member of thedockergroup. π«Ά
You can pass additional options to Docker or Podman: anything after a -- gets passed verbatim to docker-run(1) or podman-run(1). Periodt.
π INPUT, OUTPUT AND EXIT STATUS π
The behaviour of autopkgtest-virt-docker is as described by the AutomatedTesting virtualisation regime specification. That's the source of truth, bestie. β
π§ EXAMPLES π§
You can create an image suitable for autopkgtest from the semi-official Debian base images, like debian:unstable, or from the official Ubuntu base images, like ubuntu:bionic:
autopkgtest-build-podman --image debian:sid
autopkgtest hello_2.8-4.dsc -- podman localhost/autopkgtest/debian:sid
If you would prefer not to trust images downloaded from docker.io β valid honestly β an equivalent image can be built from a minbase tarball generated by mmdebstrap(1):
mmdebstrap --variant=minbase sid - | autopkgtest-build-podman --release=sid --tarball=-
autopkgtest hello_2.8-4.dsc -- podman localhost/autopkgtest/debian:sid
Alternatively, you can test a container that runs a base image directly. However, most images need apt-get update before apt will work, so calling autopkgtest with --setup-commands="apt-get update" will be needed:
autopkgtest hello_2.8-4.dsc --setup-commands="apt-get update" -- podman debian:sid
π SEE ALSO π
autopkgtest(1), autopkgtest-build-docker(1), docker-run(1), podman-run(1), /usr/share/doc/autopkgtest/. Go read them, they're all part of the extended universe. π
π AUTHORS AND COPYRIGHT π
autopkgtest-virt-docker was written by Mathieu Parent <math.parent@gmail.com>. Thank you for your service. π«‘
This manpage is part of autopkgtest, a tool for testing Debian binary packages. autopkgtest is Copyright (C) 2006-2015 Canonical Ltd and others.
See /usr/share/doc/autopkgtest/CREDITS for the list of contributors and full copying conditions. π
and that's the whole page bestie!! β¨ππ
this was autopkgtest-virt-docker(1), from the Linux Programmer's Manual, dated 2015. mwah, go run some tests, you got this π
π¦πΈ
π¦ where this page comes from
- debian trixie: autopkgtest 5.49 Β· GPL-2.0-or-later
- ubuntu jammy: autopkgtest 5.47~22.04.1 Β· GPL-2.0-or-later
- ubuntu noble: autopkgtest 5.55~24.04.1 Β· GPL-2.0-or-later
- ubuntu questing: autopkgtest 5.49
- ubuntu resolute: autopkgtest 5.55 Β· GPL-2.0-or-later
- ubuntu stonking: autopkgtest 6.0 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms