打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Dockerfile Image命令'/ bin / sh

Your problem is with the line rm -rf /var/lib/apt/lists/*. You are deleting the lists that have been fetched by the apt-get update. You then try to install a package using apt. This will fail.

You need to move rm -rf /var/lib/apt/lists/ after the line that installs mysql-server.

  1. # Download base image ubuntu 16.04
  2. FROM ubuntu:16.04
  3. # Update Ubuntu Software repository
  4. RUN apt-get update
  5. # Install PHP, nginx, mySQL
  6. RUN apt-get install -y nginx php7.0-fpm
  7. # Install MySQL and set default root password
  8. RUN echo 'mysql-server mysql-server/root_password password mypassword' | debconf-set-selections
  9. RUN echo 'mysql-server mysql-server/root_password_again password mypassword' | debconf-set-selections
  10. RUN apt-get install -y mysql-server && rm -rf /var/lib/apt/lists/*
  11. # Define the ENV variable
  12. ENV nginx_vhost /etc/nginx/sites-available/default
  13. ENV php_conf /etc/php/7.0/fpm/php.ini
  14. ENV nginx_conf /etc/nginx/nginx.conf
  15. # Enable php-fpm on nginx virtualhost configuration
  16. COPY default ${nginx_vhost}
  17. RUN sed -i -e 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' ${php_conf} && \
  18. echo "
  19. daemon off;" >> ${nginx_conf}
  20. RUN mkdir -p /run/php && \
  21. chown -R www-data:www-data /var/www/html && \
  22. chown -R www-data:www-data /run/php
  23. # Volume configuration
  24. VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"]
  25. # Configure Services and Port
  26. COPY start.sh /start.sh
  27. CMD ["./start.sh"]
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
开源资产管理系统Snipe-IT
最简单的方法配置Linux下的nginx+php
CentOS下搭建nginx+php环境
使用 Docker 高效搭建本地开发环境(详细教程)
如何从php5升级到php7,ubuntu 14 ,nginx+php7
Couldn't find package php5-fpm
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服