【发布时间】:2018-08-06 19:58:15
【问题描述】:
我有 dockerfile,它具有以下用于构建映像的命令
FROM postgres:9.6.2-alpine
COPY postgresql.conf /docker-entrypoint-initdb.d/postgresql.conf
COPY postgres-*.sh /docker-entrypoint-initdb.d/
CMD ["postgres", "-c", "config_file=/docker-entrypoint-
initdb.d/postgresql.conf"]
并从存储库中的这个图像创建另一个本地 docker 图像作为
ARG FROM_IMAGE_TAG=v9.6.2-latest
FROM <url for the image above>:${FROM_IMAGE_TAG}
COPY postgres-create-zfunction.sql /docker-entrypoint-initdb.d/
第二个 dockerfile 中的脚本被复制到容器中,但没有被执行。当我尝试在本地运行 scipt 时,它在容器内完美运行,但是在启动期间它没有被执行,而且我也没有看到容器中的任何错误日志。
任何关于如何运行脚本的建议都会有所帮助
【问题讨论】:
标签: postgresql docker docker-compose dockerfile