Docker Community Forums

Share and learn in the Docker community.

Docker stop behaving differently on different operating systems

I am running a java application image using docker run <image_id> with two different setups below.
when I do docker stop <container_id> the graceful shutdown doesn’t work properly in Debian while it works fine in MacOs.

Can someone please help, not really sure what can cause this different behaviours.

Setup-1
OS: MAC OS BIGSUR
Docker: 18.09.2
Setup-2
OS: Debian GNU/Linux 9.12 (stretch)
Docker: 18.09.4

Output of docker info:

$ docker info
Client:
Debug Mode: false

Server:
Containers: 2
Running: 0
Paused: 0
Stopped: 2
Images: 88
Server Version: 19.03.8
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 151
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
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: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 5.4.0-29-generic
Operating System: Ubuntu 20.04 LTS
OSType: linux
Architecture: x86_64
CPUs: 24
Total Memory: 31.34GiB
Name: codex
ID: ZRAP:TBB3:NYOT:X6KF:NUBD:QUQ2:VD6O:X3PV:5QSQ:2NAL:5HQ5:UQPC
Docker Root Dir: /var/lib/docker
Debug Mode: false
Username: giszmo
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support
WARNING: the aufs storage-driver is deprecated, and will be removed in a future release.
Additional environment details (AWS, VirtualBox, physical, etc.)

As explained on this stackoverflow question, this issue persists after upgrading ubuntu 19.10 to 20.04 and docker from 19.03.6 to 19.03.8 and was tested on a total of 8 systems. Using docker on my machine breaks build reproducibility while not using Docker can produce reproducible builds where others use Docker to reproduce.