Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker exec can not exit when run with pid namespace #45120

Open
kamizjw opened this issue Mar 8, 2023 · 2 comments
Open

docker exec can not exit when run with pid namespace #45120

kamizjw opened this issue Mar 8, 2023 · 2 comments
Labels
kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/0-triage version/20.10

Comments

@kamizjw
Copy link

kamizjw commented Mar 8, 2023

Description

1.docker run a new container with pidnamespace
2.docker exec this container
3.docker rm -f this container
finally,docker exec is not exit,example like this:

 docker run -itd --pid=host busybox  sh
368ca7afbf63920b48fe200a3e41231c6411f728a9492e9c8df1c50413738303

[root@localhost ~]# docker exec -it 368ca7afbf63920b48fe200a3e41231c6411f728a9492e9c8df1c50413738303 sh
/ # 

docker rm in another shell windows
[root@localhost ~]# docker rm -f 368ca7afbf63920b48fe200a3e41231c6411f728a9492e9c8df1c50413738303
368ca7afbf63920b48fe200a3e41231c6411f728a9492e9c8df1c50413738303


observe that the exec process does not exit
[root@localhost ~]# docker exec -it 368ca7afbf63920b48fe200a3e41231c6411f728a9492e9c8df1c50413738303 sh
/ # 

result is that docker exec is not exit,but when we do not specify “--pid” parameters to run container,exec process exit successfully

Reproduce

1.docker run -itd --pid=host busybox sh
2.docker exec -it 368ca7afbf63920b48fe200a3e41231c6411f728a9492e9c8df1c50413738303 sh
3.docker rm -f 368ca7afbf63920b48fe200a3e41231c6411f728a9492e9c8df1c50413738303

Expected behavior

No response

docker version

Client: Docker Engine - Community
 Version:           20.10.23
 API version:       1.41
 Go version:        go1.18.10
 Git commit:        7155243
 Built:             Thu Jan 19 17:34:59 2023
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.23
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.10
  Git commit:       6051f14
  Built:            Thu Jan 19 17:32:36 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          
  GitCommit:        .m
 runc:
  Version:          1.1.3
  GitCommit:        b17d05d6bfb1f6d087f5585e5236ffc04173af69

docker info

Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 16
  Running: 0
  Paused: 0
  Stopped: 16
 Images: 20
 Server Version: 20.10.23
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: .m
 runc version: b17d05d6bfb1f6d087f5585e5236ffc04173af69
 init version: N/A
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.0-60.18.0.50.h763.eulerosv2r11.x86_64
 Operating System: EulerOS 2.0 (SP11x86_64)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.249GiB
 Name: localhost.localdomain
 ID: TNWQ:CZYP:AKFK:IA5Q:74RD:3NQK:J4QG:QF3J:JULD:EWBV:I26E:U45J
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 28
  Goroutines: 50
  System Time: 2023-03-09T10:17:24.793244491+08:00
  EventsListeners: 0
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  10.175.125.206:80
  127.0.0.0/8
 Live Restore Enabled: true

Additional Info

No response

@kamizjw kamizjw added kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/0-triage labels Mar 8, 2023
@kamizjw kamizjw changed the title docker exec can exit when run with pidnamespace docker exec can not exit when run with pidnamespace Mar 8, 2023
@kamizjw kamizjw changed the title docker exec can not exit when run with pidnamespace docker exec can not exit when run with pid namespace Mar 9, 2023
@sam-thibault
Copy link
Contributor

@kamizjw
Copy link
Author

kamizjw commented Mar 13, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/0-triage version/20.10
Projects
None yet
Development

No branches or pull requests

2 participants