如何通过Dockerfile中的命令来填充表

我build立(没有错误) mypostgres图像。 有与postgresql相关的命令:

 RUN /etc/init.d/postgresql start &&\ psql --command "CREATE USER cobrain WITH SUPERUSER PASSWORD 'cobrain';" &&\ createdb -O cobrain datasets &&\ psql --command "CREATE TABLE datasets (id varchar PRIMARY KEY, creation_timestamp bigint, type varchar, owner varchar, datafiles varchar[]);" &&\ psql --command "INSERT INTO datasets (id, creation_timestamp, type, owner, datafiles) VALUES ('111', 1111345, 'MEDICAL', 'Yandex', ARRAY['blood.data'])" 

我运行容器:

 docker run -p 32779:5432 mypostgres:latest 

然后在另一个terminal,我尝试访问postgres服务:

 psql -h localhost -p 32779 -U cobrain datasets datasets=# select * from datasets; ERROR: relation "datasets" does not exist 

要么

 datasets=# \dt; No relations found. 

这些消息对我来说很奇怪,因为我在表中创build并插入了值。 如何克服它们,并select语句?