No description
  • C 62.5%
  • Shell 33.3%
  • Makefile 2.1%
  • Meson 1.1%
  • Nix 0.9%
  • Other 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jindrich Novy d0c4a2144e
Merge pull request #666 from containers/renovate/bats-core-bats-core-1.x
chore(deps): update dependency bats-core/bats-core to v1.14.0
2026-07-22 11:19:27 +02:00
.github chore(deps): update actions/setup-go action to v7 2026-07-22 09:19:08 +00:00
.rpmbuild Initial PAPR CI check-in 2018-10-02 17:02:45 -05:00
contrib/spec Cirrus: Remove disused scripts 2021-09-28 09:41:55 -04:00
docs Document all CLI options 2025-09-24 13:46:41 +02:00
hack chore(deps): update dependency bats-core/bats-core to v1.14.0 2026-07-22 09:19:04 +00:00
logo Add the official conmon logo to README.md 2026-03-04 11:31:11 +01:00
nix Add optional systemd support for static builds 2025-08-11 17:47:58 +02:00
rpm RPM spec: modernize spec file 2026-03-04 11:48:31 +01:00
src Merge pull request #664 from arpitjain099/fix/bundle-path-use-after-scope 2026-07-22 10:42:13 +02:00
test tests: fail if runc start failed 2026-03-11 15:15:24 -07:00
.clang-format Add .clang-format file 2019-05-22 08:40:52 +02:00
.dir-locals.el .dir-locals.el: new file 2020-03-20 08:43:12 -04:00
.gitignore Show the code coverage in make test-coverage output. 2025-09-16 10:19:47 +02:00
.packit.yaml Packit: constrain downstream jobs to the fedora package 2024-10-08 16:48:29 +05:30
changelog.txt Add Changelog 2019-08-05 10:02:57 -04:00
CODE-OF-CONDUCT.md Fix docs links due to branch rename 2021-06-10 13:15:32 -04:00
Containerfile Switch tests from busybox to UBI10 and add consistent terminal size validation 2025-10-02 14:57:08 +02:00
LICENSE remove appendix 2019-06-17 09:13:38 -04:00
Makefile signal: replace raise(SIGUSR1) with self-pipe to fix SIGABRT on glibc >= 2.42 2026-05-18 12:19:02 +02:00
meson.build signal: replace raise(SIGUSR1) with self-pipe to fix SIGABRT on glibc >= 2.42 2026-05-18 12:19:02 +02:00
README.md Add the official conmon logo to README.md 2026-03-04 11:31:11 +01:00
SECURITY.md Fix docs links due to branch rename 2021-06-10 13:15:32 -04:00
VERSION Release v2.2.1 2026-02-12 17:58:22 +01:00

conmon logo

conmon

An OCI container runtime monitor.

Conmon is a monitoring program and communication tool between a container manager (like Podman or CRI-O) and an OCI runtime (like runc or crun) for a single container.

Upon being launched, conmon (usually) double-forks to daemonize and detach from the parent that launched it. It then launches the runtime as its child. This allows managing processes to die in the foreground, but still be able to watch over and connect to the child process (the container).

While the container runs, conmon does two things:

  • Provides a socket for attaching to the container, holding open the container's standard streams and forwarding them over the socket.
  • Writes the contents of the container's streams to a log file (or to the systemd journal) so they can be read after the container's death.

Finally, upon the containers death, conmon will record its exit time and code to be read by the managing programs.

Written in C and designed to have a low memory footprint, conmon is intended to be run by a container managing library. Essentially, conmon is the smallest daemon a container can have.

In most cases, conmon should be packaged with your favorite container manager. However, if you'd like to try building it from source, follow the steps below.

Dependencies

These dependencies are required for the build:

sudo yum install -y \
  gcc \
  git \
  glib2-devel \
  glibc-devel \
  libseccomp-devel \
  systemd-devel \
  make \
  pkgconfig \
  runc
sudo apt-get install \
  gcc \
  git \
  libc6-dev \
  libglib2.0-dev \
  libseccomp-dev \
  pkg-config \
  make \
  runc

Build

Once all the dependencies are installed:

make

There are three options for installation, depending on your environment. Each can have the PREFIX overridden. The PREFIX defaults to /usr/local for most Linux distributions.

  • make install installs to $PREFIX/bin, for adding conmon to the path.
  • make podman installs to $PREFIX/libexec/podman, which is used to override the conmon version that Podman uses.
  • make crio installs to $PREFIX/libexec/crio, which is used to override the conmon version that CRI-O uses.

Note, to run conmon, you'll also need to have an OCI compliant runtime installed, like runc or crun.

Testing

Once you have successfully built conmon, run the tests using:

make test

Note that you'll also need the bats and socat packages install if not present.

Static build

It is possible to build a statically linked binary of conmon by using the officially provided nix package and the derivation of it within this repository. The builds are completely reproducible and will create a x86_64/amd64 stripped ELF binary for glibc.

Nix

To build the binaries by locally installing the nix package manager:

nix build -f nix/

Ansible

An Ansible Role is also available to automate the installation of the above statically linked binary on its supported OS:

sudo su -
mkdir -p ~/.ansible/roles
cd ~/.ansible/roles
git clone https://github.com/alvistack/ansible-role-conmon.git conmon
cd ~/.ansible/roles/conmon
pip3 install --upgrade --ignore-installed --requirement requirements.txt
molecule converge
molecule verify