An OCI container runtime monitor.
Go to file
Jindrich Novy 92e29d9b78 Fix CI: Remove Go dependencies and fix missing make targets
- Remove GOPATH and golang package installations from all CI tasks
- Replace missing 'make config' target with build verification
- Add proper build dependencies (systemd-devel, libseccomp-devel)
- Update working directory path to remove Go-specific structure

Signed-off-by: Jindrich Novy <jnovy@redhat.com>
2025-08-29 10:26:51 -04:00
.github Fix CI: Remove Go dependencies and fix missing make targets 2025-08-29 10:26:51 -04: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 logging: Add container labels to log entries on journald 2025-06-01 00:49:41 +03:00
hack Replace Go tests with BATS and remove Go dependency 2025-08-28 12:08:38 +02:00
nix Add optional systemd support for static builds 2025-08-11 17:47:58 +02:00
rpm Fix CI: Remove Go dependencies and fix missing make targets 2025-08-29 10:26:51 -04:00
src Fix errno race condition and logging macro issues 2025-08-13 19:01:00 +02:00
test Replace Go tests with BATS and remove Go dependency 2025-08-28 12:08:38 +02:00
.cirrus.yml Fix CI: Remove Go dependencies and fix missing make targets 2025-08-29 10:26:51 -04: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 Remove go.sum file and add go.mod 2020-08-27 09:12:36 -04:00
.packit.yaml Packit: constrain downstream jobs to the fedora package 2024-10-08 16:48:29 +05:30
CODE-OF-CONDUCT.md Fix docs links due to branch rename 2021-06-10 13:15:32 -04:00
Containerfile Use Podman for building 2020-08-05 11:18:54 -04:00
LICENSE remove appendix 2019-06-17 09:13:38 -04:00
Makefile Merge pull request #579 from jnovy/bats 2025-08-28 15:34:31 +02:00
README.md README.md: update the correct Nix channel 2023-12-13 09:21:17 +08:00
SECURITY.md Fix docs links due to branch rename 2021-06-10 13:15:32 -04:00
VERSION Bump conmon version to 2.1.13 2025-02-25 13:04:08 -05:00
changelog.txt Add Changelog 2019-08-05 10:02:57 -04:00
meson.build Remove checks for (long)deprecated libsystemd-journal in favor of libsystemd 2024-01-26 10:03:37 -05:00

README.md

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 \
  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.

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