linux命令行下运行:
service docker start
执行下面dockerfile文件来创建镜像:
docker build -t phpswooleredis:v1 .
FROM php:7.4-fpm
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -y \
--no-install-recommends libfreetype6-dev libjpeg62-turbo-dev libpng-dev curl \
&& rm -r /var/lib/apt/lists/* \
&& docker-php-ext-configure gd \
&& docker-php-ext-install -j$(nproc) gd opcache pdo_mysql gettext sockets
RUN pecl install redis \
&& pecl install swoole \
&& docker-php-ext-enable redis swoole
ENV COMPOSER_HOME /root/composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
ENV PATH $COMPOSER_HOME/vendor/bin:$PATH
WORKDIR /data
之后创建容器即可😁
1 Comment
helloword