Home  >  Q&A  >  body text

docker pull 一个lnmp的镜像下来安装 怎么修改他的配置

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

淡淡烟草味淡淡烟草味2707 days ago779

reply all(4)I'll reply

  • 高洛峰

    高洛峰2017-04-25 09:03:58

    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

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-25 09:03:58

    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.

    reply
    0
  • 某草草

    某草草2017-04-25 09:03:58

    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

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-04-25 09:03:58

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

    reply
    0
  • Cancelreply