An OCI container runtime monitor.
Go to file
Haiyue Wang 521f5859f9 README.md: update the correct Nix channel
Correct the conmon Nix channel information to fix search error "Wrong channel selected!".

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
2023-12-13 09:21:17 +08:00
.github ci: skip broken cri-o tests 2023-12-12 10:17:57 -05:00
.rpmbuild Initial PAPR CI check-in 2018-10-02 17:02:45 -05:00
cmd/conmon-config Fail if conmon config could not be written 2020-08-26 09:10:10 -04:00
contrib/spec Cirrus: Remove disused scripts 2021-09-28 09:41:55 -04:00
docs fix propagation of PREFIX variable to docs/Makefile 2021-01-15 13:28:53 +01:00
hack Update nixos image and dependencies' version. 2023-05-15 14:03:48 -04:00
nix Update nix and use an overlay 2023-08-15 09:33:08 -04:00
runner vendor: bump to latest packages 2023-05-01 14:39:27 -04:00
src Merge pull request #470 from alexlarsson/fix-socket-size 2023-12-12 17:10:20 +01:00
tools Lint/format fixes for golang 1.19 2023-02-01 14:41:20 -05:00
.cirrus.yml CI: Update Fedora names 2023-10-23 13:56:27 -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: update config 2023-05-03 11:28:01 -04:00
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 Update nix and use an overlay 2023-08-15 09:33:08 -04: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 to v2.1.8 2023-08-24 10:12:18 -04:00
changelog.txt Add Changelog 2019-08-05 10:02:57 -04:00
go.mod fix(deps): update module github.com/onsi/ginkgo/v2 to v2.12.0 2023-08-30 10:09:01 -04:00
go.sum fix(deps): update module github.com/onsi/ginkgo/v2 to v2.12.0 2023-08-30 10:09:01 -04:00
meson.build meson: build with seccomp if available 2022-07-25 13:00:32 -04: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