I installed Docker EE on Windows Server 2016 and 2019. I am spinning up a PostgreSQL container and have an initdb.sql script to initialize the database.
I am using Windows containers, and have tested the script both in docker and docker-compose on Windows 10 in Windows Containers mode. The moment I move it to Windows Server 2016/2019, the database spins up but it does not run the initdb.sql script.
Here is my docker-compose
version: "3"
networks:
localnetwork:
services:
postgres_db:
image: stellirin/postgres-windows:12-1809
restart: unless-stopped
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
volumes:
- .\admin\${ENV:-dev}\dbms\init:C:\docker-entrypoint-initdb.d
ports:
- "5432:5432"
networks:
- localnetwork
How do I get Windows Server 2016/2019 to run the initdb.sql? I cannot docker exec into the container either because it returns Access is denied.
Note, Access is denied is also the case in Windows 10. But I can use Docker Desktop's interface to somehow get into the container to check. Docker EE has no Docker Desktop so this cannot be done.
