I have a Dockerfile
COPY ./docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
USER postgres
ENTRYPOINT ["/docker-entrypoint.sh"]
最初的回答中提到的docker-entrypoint.sh是什么?
#!/bin/sh
# Before PostgreSQL can function correctly, the database cluster must be initialized:
initdb -D /var/lib/postgres/data
#start postgres server
/usr/bin/postgres -D /var/lib/postgres/data &
# create a user or role
psql -d postgres -c "CREATE USER someuser WITH PASSWORD 'jkhkjah';"
# create database
psql -d postgres -c "CREATE DATABASE dockertest OWNER 'someuser';"
它没有创建someuser和dockertest数据库。怎么办?最初的回答是: