如何在Docker容器应用程序中持久/保留sqlite数据库?

时间:2019-07-24 07:40:52

标签: sqlite docker

我使用的是gophish框架,我已使用以下docker文件对gophish进行了docker化:

FROM debian:jessie

RUN apt-get update && \
apt-get install --no-install-recommends -y \
unzip \
ca-certificates \
wget && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN apt-get update && \ 
apt-get install -y sqlite3 libsqlite3-dev

# Set the Current Working Directory inside the container
WORKDIR /opt/gophish-v0.6.0-linux-64bit

# Copy everything from the current directory to the PWD(Present Working Directory) inside the container
COPY . .

RUN sed -i "s|**.**.**.***|0.0.0.0|g" config.json && \
chmod +x gophish

EXPOSE 80 80 8089 8089

ENTRYPOINT ["./gophish"]

应用程序在Azure虚拟机和本地上运行良好,问题在于SQLite数据库位于Docker容器本身中,因此在每个Docker构建中,数据库均变为空白。 如何保留SQLite数据库?

Docker的新手。 有帮助吗?

0 个答案:

没有答案