containerd / containerd/nerdctl

`nerdctl stop` should release rootless ports (OCI `poststop` event should be called on `nerdctl stop`)

Open
#458 4 comments 0 reactions 0 assignees View on GitHub
area/rootless bug
Dominant language
Go
Stars
10.4k
Forks
826
Avg merge
1d 23h
Merged PRs (30d)
44

Description

```console
$ nerdctl --version
nerdctl version 0.12.1-58-g757f823

$ nerdctl run -d --name nginx -p 8080:80 nginx:alpine
5debf438f4632aaf6346d022b8a98c89c36b03e729f21f5e3f89b718a370f2da

$ nerdctl stop nginx
nginx

$ lsof -i -P
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
rootlessk 131938 suda 12u IPv6 3543002 0t0 TCP *:8080 (LISTEN)

$ rootlessctl --socket /run/user/1001/containerd-rootless/api.sock list-ports
ID PROTO PARENTIP PARENTPORT CHILDIP CHILDPORT
7 tcp 0.0.0.0 8080 8080
```

The port should be released after `nerdctl stop`.

It looks like [the OCI `poststop` event hook](https://github.com/containerd/nerdctl/blob/757f82379192f71d9604fa98918aec9110f247e5/pkg/ocihook/ocihook.go#L347) is not executed for `nerdctl stop`.

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.