Docker Community Forums

Share and learn in the Docker community.

Exec'ing commands in running container crashes terminal [Updated]

[Update] I finally discovered that this problem is not a docker problem but was self-inflicted. A side effect of running an ansible script to install my docker image was to accidentally set /tmp to be owned by root with permission 755. Not being able to write to /tmp as a normal user caused lots of commands to crash the terminal - not just docker commands the way I originally thought.

I have my own postgres image that is causing me major problems. The container runs fine - I can access the postgres process in the container. However, when I try to run a command in the container, e.g.

docker exec postgres netstat -antp

the terminal I’m running that docker exec from receives a SIGABRT and terminates. The same thing happens when I run the command from bash inside the container. That is,

docker exec -it postgres bash

works fine, but then running

netstat -antp

crashes the terminal. Many other commands have the same problem - I am just using netstat as a simple example. Even

docker logs postgres and
docker inspect postgres

crash the terminal.

This is my docker info

docker info

Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 8
Server Version: 1.13.1
Storage Driver: devicemapper
Pool Name: docker-253:0-202669215-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 3.151 GB
Data Space Total: 107.4 GB
Data Space Available: 28.53 GB
Metadata Space Used: 6.463 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.141 GB
Thin Pool Minimum Free Space: 10.74 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for production use. Use --storage-opt dm.thinpooldev to specify a custom block storage device.
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.135-RHEL7 (2016-11-16)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1
runc version: 9df8b306d01f59d3a8029be411de015b7304dd8f
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-514.6.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.702 GiB
Name: ph-db.cisco.com
ID: DTRC:TQPU:75WI:YHRW:EEPI:JCTZ:CKVW:ORXH:INFU:D6SI:LFOP:UQCP
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false