0

Still trying to learn docker. I am mounting a Postgres image using docker-compose :

version: '3.7'
services:
    postgres:
        container_name:postgres-container
        image: postgres:12
        ports:
        - 5432:5432
        environment:
        - POSTGRES_DB=postgres
        - POSTGRES_PASSWORD=password
        - POSTGRES_USER=postgres

After running it sucessfully I run docker ps and there is no new container. But if I use postgres:11 it creates the container correctly.

Also if I do docker run -d postgres:latest it works.

What is causing this error ? I do not understand

  • 1
    Works for me with :12 and :latest (they are the very same image). When the container starts there are progress messages. If you don't see them in the terminal you can retrieve them with docker logs postgres-container. – xenoid Feb 4 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.