构建自己的docker镜像
2024-2-3 23:8:3 Author: blog.upx8.com(查看原文) 阅读量:24 收藏

创建目录

mkdir -p /home/kejilion/php && cd /home/kejilion/php

创建Dockerfile

nano Dockerfile

配置

FROM php:fpm

RUN apt update && apt install -y curl

RUN mkdir -p /usr/local/bin/

RUN curl -sL https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o /usr/local/bin/install-php-extensions

RUN chmod +x /usr/local/bin/install-php-extensions

RUN install-php-extensions mysqli gd intl zip opcache exif imagick redis pdo_mysql bcmath

RUN echo "upload_max_filesize=50M\npost_max_size=50M" > /usr/local/etc/php/conf.d/uploads.ini

RUN echo "memory_limit=256M" > /usr/local/etc/php/conf.d/memory.ini

RUN echo "max_execution_time=1200" > /usr/local/etc/php/conf.d/max_execution_time.ini

RUN echo "max_input_time=600" > /usr/local/etc/php/conf.d/max_input_time.ini

CMD ["php-fpm"]

构建镜像

docker login

docker buildx create --use

docker buildx build --platform linux/amd64,linux/arm/v5 -t kjlion/php:8.3 .

docker push kjlion/php:8.3


文章来源: https://blog.upx8.com/4008
如有侵权请联系:admin#unsafe.sh