利用官方镜像+Dockerfile构建符合自己要求PHP7.4镜像 DockerFile apt官方源太慢时,切换apt源该dockerfile支持的php额外扩展 bcmatch event exif gd Mysqli iconv pc
FROM php:7.4.33-fpmENV TZ=Asia/ShanghaiRUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone#切换apt源 需要就放开#RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak#ADD sources.list /etc/apt/#RUN cat /etc/apt/sources.listRUN apt-get clean all && apt-get update && apt-get install -y \#部分调试工具,线上环境不需要#telnet curl vim inetutils-ping \libevent-dev pkg-config libxml2 libxml2-dev openssl libssl-dev sqlite3 \libsqlite3-dev libpng-dev libjpeg-dev libfreetype-dev \ && docker-php-ext-install pdo_mysql mysqli \ && docker-php-ext-install bcmath exif gd iconv pcntlRUN pecl install redis && docker-php-ext-enable redis \&& docker-php-ext-install sockets && docker-php-ext-enable sockets \&& pecl install event-3.0.6 && docker-php-ext-enable event \&& rm -rf /tmp/pear#安装composeRUN curl -sS https://getcomposer.org/installer | php -- \--install-dir=/usr/bin --filename=composerRUN chmod a+x /usr/bin/composer \ && composer config -g repo.packaGISt composer Https://mirrors.aliyun.com/composer/EXPOSE 9000
#http://mirrors.163.com/debian/为软件源也可以为其他的 bullseye为版本代号 main non-free contrib区别如下deb http://mirrors.163.com/debian/ bullseye main non-free contribdeb http://mirrors.163.com/debian/ bullseye-updates main non-free contribdeb http://mirrors.163.com/debian/ bullseye-backports main non-free contribdeb-src http://mirrors.163.com/debian/ bullseye main non-free contribdeb-src http://mirrors.163.com/debian/ bullseye-updates main non-free contribdeb-src http://mirrors.163.com/debian/ bullseye-backports main non-free contrib#deb http://mirrors.163.com/debian-security/ bullseye/updates main non-free contrib#deb http://mirrors.ustc.edu.cn/debian-security/ bullseye/updates main non-free contrib#deb-src http://mirrors.163.com/debian-security/ bullseye/updates main non-free contrib#deb-src http://mirrors.ustc.edu.cn/debian-security/ bullseye/updates main non-free contribdeb http://mirrors.ustc.edu.cn/debian-security/ stable-security main non-free contribdeb-src http://mirrors.ustc.edu.cn/debian-security/ stable-security main non-free contrib
version: "3"networks: WEBnet: driver: bridgeservices: php: build: ./php image: php:7.4-local container_name: php restart: always expose: - 9000 stdin_open: true tty: true environment: - TZ=Asia/Shanghai volumes: - ${WWW_DIR}:/www - ./php/etc/php.ini:/usr/local/etc/php/php.ini - ./php/etc/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf networks: - webnet
来源地址:https://blog.csdn.net/u011105165/article/details/128133891
--结束END--
本文标题: Docker-compose+Dockerfile构建并启动php7.4镜像
本文链接: https://lsjlt.com/news/387861.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0