这是我用于安装 Postgres 的 Dockerfile。
# Set the base image to Ubuntu
FROM ubuntu:14.04
# Update the repository sources list
RUN apt-get update -y
################## BEGIN INSTALLATION ######################
# Install wget
RUN apt-get install wget -y
# Setup Postgres repository
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc
| sudo apt-key add -
# Add Postgres repository
RUN sh -c "echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list"
# Update repository
RUN apt-get update -y
# Install Postgres with Postgis
RUN apt-get install postgresql-9.3-postgis-2.1 -y
我如何为 Postgres 添加入口点,以便 Postgres 在 Docker 容器中自动启动
最佳答案
我的自动启动 Postgres 的解决方案:
RUN chmod +x /etc/init.d/postgresql
CMD service postgresql start && tail -F /var/lib/postgresql/data/serverlog
关于postgresql - Postgres 9.3 的 Docker 入口点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37339731/