Docker Community Forums

Share and learn in the Docker community.

How to runnig sql script file


(Erkant87) #1

hello,
I want .sql file run with exec command.
image: postgres:alpine
connection : succesful

#docker cp ./test.sql postgresql_database/docker-entrypoint-initdb.d/test.sql
# docker exec postgresql_database -u postgres psql postgres -f docker-entrypoint-initdb.d/test.sql 
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"-u\": executable file not found in $PATH": unknown

how does this work? thank you for help