docker pull 一个lnmp的镜像下来安装 怎么修改他的配置
淡淡烟草味
淡淡烟草味 2017-04-25 09:01:58
0
4
814

docker pull 一个lnmp的镜像下来安装 怎么修改他的配置 比如说我要给php 加个扩展 nginx 修改点域名之类的

淡淡烟草味
淡淡烟草味

reply all(4)
小葫芦
  1. Use commands like docker run -it -u root 镜像名 /bin/bash to change it

  2. After making the changesexitExit

  3. Thendocker commit <container ID> 新的镜像名submit your image

大家讲道理

It is recommended to use the configuration file in the form of a data volume and replace the original configuration in the container, including the PHP extension. You can create a new temporary container, compile the extension and export it to the host, and then mount it into the lnmp container through mounting. In the directory, just specify the corresponding directory and file in the configuration of php.ini.

It is not recommended to modify the configuration after entering the container and then submit it. The process of modifying the configuration again is very cumbersome.

某草草

It is recommended that you repackage the new image based on it, and modify or overwrite the original configuration file.
Example:

FROM nginx:latest

ADD . /opt/flask/

RUN cp  /opt/flask/flask.conf /etc/nginx/nginx.conf

VOLUME ["/opt/flask/media"]
VOLUME ["/opt/flask/static"]
EXPOSE 80
仅有的幸福

Owner, I am a newbie.
Looking for a mirror of lamp or lnmp

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!