每次在Windows CLI中执行docker-compose up -d命令时,我都会得到这个错误。请帮我解决这个问题。Docker-compose。我使用的yml文件是Laminas骨架应用程序的一部分,并在那里预先编写。这是docker-compose。yml代码:
laminas:
build: .
dockerfile: Dockerfile
ports:
- "8081:80"
volumes:
- .:/var/www
以下是Dockerfile代码:
FROM php:7.3-apache
LABEL maintainer="getlaminas.org"
org.label-schema.docker.dockerfile="/Dockerfile"
org.label-schema.name="Laminas MVC Skeleton"
org.label-schema.url="https://docs.getlaminas.org/mvc/"
org.label-schema.vcs-url="https://github.com/laminas/laminas-mvc-skeleton"
## Update package information
RUN apt-get update
## Configure Apache
RUN a2enmod rewrite
&& sed -i 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/000-default.conf
&& mv /var/www/html /var/www/public
## Install Composer
RUN curl -sS https://getcomposer.org/installer
| php -- --install-dir=/usr/local/bin --filename=composer
###
## PHP Extensisons
###
## Install zip libraries and extension
RUN apt-get install --yes git zlib1g-dev libzip-dev
&& docker-php-ext-install zip
## Install intl library and extension
RUN apt-get install --yes libicu-dev
&& docker-php-ext-configure intl
&& docker-php-ext-install intl
WORKDIR /var/www
对于那些刚接触Docker的人,你想做的是
services: # Add this
laminas:
build: .
dockerfile: Dockerfile
ports:
- "8081:80"
volumes:
- .:/var/www