1

I have running container docker run -it --rm -d postgres. I can even connect to it with 172.17.0...:5432 IP. But

$service --status-all
 [ - ]  cron
 [ - ]  exim4
 [ ? ]  hwclock.sh
 [ - ]  postgresql
 [ - ]  procps
 [ - ]  sysstat

How can postgres work if service even hasn't been started ?

1 Answer 1

1

You do not provide any port mappings when starting the container. My guess is that you are connecting to your locally installed Postgres instance instead of your postgres container.

Start the postgres container with: docker run --rm -p:5433:5432 -d postgres

Then connect by using the port 5433.

Sign up to request clarification or add additional context in comments.

1 Comment

psql -h 172.17.0.3 -p 5432 -U postgres it's my request to docker bd (I do not connect with local bd) . Mapping didn't help and I see no connection between mapping and running the service postgresql.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.