containerd / containerd/nerdctl

Docker compatible events stream

Open
#2,856 1 comment 0 reactions 0 assignees View on GitHub
kind/feature
Dominant language
Go
Stars
10.4k
Forks
826
Avg merge
1d 23h
Merged PRs (30d)
44

Description

### What is the problem you're trying to solve

I'd like to start the discussion on supporting Docker compatible events with `nerdctl events` command. The events stream returned by nerdctl is significantly different from `docker events`. Example, for a `container start` event:
```
$ nerdctl events --format '{{json .}}'
{"Timestamp":"2024-03-05T18:21:13.926302522Z","Namespace":"default","Topic":"/tasks/start","Event":"{\"container_id\":\"51885cadba61b9640f0ea80eb716b2f2e2bc60b42595db07bd8759e06b270fdb\",\"pid\":49760}"}
```
```
$ docker events --format '{{json .}}'
{"status":"start","id":"84f2374dda918b45b0d775409f17cbd2eb4ccf6f58b32b80493e9bac3bd240d2","from":"alpine","Type":"container","Action":"start","Actor":{"ID":"84f2374dda918b45b0d775409f17cbd2eb4ccf6f58b32b80493e9bac3bd240d2","Attributes":{"image":"alpine","name":"sweet_noyce"}},"scope":"local","time":1709663022,"timeNano":1709663022762686221}
```

Some of the events are not reported (eg: networking and volume related events) because they are not integrated with containerd. This breaks certain tools that rely on event notifications.

### Describe the solution you'd like

I'd like to have a docker compatible option, or have it be the default mode:
```
$ nerdctl events --format '{{json .}}' --mode "dockercompat"
```

### Additional context

The events command in nerdctl simply reports events emitted by containerd. However, I think as a CLI, nerdctl should have the ability to report its own events for features such as network and volume management. Additionally, having its own set of events would make it easier for nerdctl to output a Docker compatible events stream.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.