我剛剛在讀docker文件HERE。瞭解postgresql的一個簡單的dockerfile
和基本Dockerfile看起來像如下:
FROM postgres:9.1
MAINTAINER Mike Dillon <[email protected]>
ENV POSTGIS_MAJOR 2.1
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
postgis=$POSTGIS_VERSION \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /docker-entrypoint-initdb.d
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh
我要確保我已經解釋了以下正確兩條命令:
RUN mkdir -p /docker-entrypoint-initdb.d
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh
運行命令運行mkdir
命令,表示當前目錄將有一個子目錄稱爲:
/docker-entrypoint-initdb.d
和下一個命令I.E. COPY命令的目錄./initdb-postgis.sh
的內容正在被複制到/docker-entrypoint-initdb.d/postgis.sh
,我說得對嗎?