Guilherme Tocchetto
Guilherme Tocchetto

Reputation: 185

Unable to start docker container, "docker ps -a" STATUS = Exited (1)

I'm trying to start a postgres instance as described in docker hub.

To do that, I ran the following command:

sudo docker run --name database -e POSTGRES_PASSWORD=supersecret -p 5432:5432 -d postgres

When I run docker ps it shows nothing, and when I run docker ps -a it shows:

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES
967ebe7efb74        postgres            "docker-entrypoint.s…"   2 minutes ago       Exited (1) 2 minutes ago                        database

Trying to docker start database also leads to STATUS Exited (1) as displayed above.

Here are the logs displayed by docker logs -f database:

PostgreSQL init process complete; ready for start up.

2019-09-10 14:08:26.941 UTC [1] LOG:  could not create IPv6 socket for address "::": Permission denied
2019-09-10 14:08:26.941 UTC [1] LOG:  could not create IPv4 socket for address "0.0.0.0": Permission denied
2019-09-10 14:08:26.941 UTC [1] WARNING:  could not create listen socket for "*"
2019-09-10 14:08:26.941 UTC [1] FATAL:  could not create any TCP/IP sockets
2019-09-10 14:08:26.941 UTC [1] LOG:  database system is shut down

In my research on the internet to solve this problem, some people said that it could be something with my hosts file, but it seems fine as shown below.

127.0.0.1   localhost
127.0.1.1   user-PC

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

I tried to reinstall docker following the docker docs step-by-step tutorial, and I also did the post installation steps without success.

OS: Deepin GNU/Linux 15.11 Docker: Docker version 18.09.6, build 481bc77

Upvotes: 2

Views: 1002

Answers (1)

gile
gile

Reputation: 6006

Because you confirmed it, I write the comment as answer.

Problem is due to apparmor. Try disabling it or, better, to configure the security profile

Upvotes: 1

Related Questions