Docker PHP图像。 lstat docker-php-source:没有这样的文件或目录

时间:2017-06-16 09:27:22

标签: php docker docker-compose dockerfile

我正在尝试设置PHP 5.6.30 fp,但是我收到了错误。 错误与此处(Docker) Getting error: docker-php-source: no such file or directory when building docker file

相同

但我不明白如何解决这个问题。 我的文件夹看起来像

应用    --docker       --workspace

内部工作区Dockerfile我从https://github.com/docker-library/php/blob/eadc27f12cfec58e270f8e37cd1b4ae9abcbb4eb/5.6/fpm/Dockerfile

粘贴所有内容

Step 15/22 : COPY docker-php-source /usr/local/bin/ ERROR: Service 'workspace' failed to build: lstat docker-php-source: no such file or directory

那么我必须做什么? 我之前做过这个命令docker pull php并没有帮助。

所以我有这个.yml文件

version: '2' services: app: build: ./docker/app volumes: - .:/var/www/html command: "true" workspace: build: ./docker/workspace volumes_from: - app links: - php - nginx tty: true depends_on: - app nginx: build: ./docker/nginx ports: - 8080:80 links: - php volumes_from: - app php: build: ./docker/php expose: - "9000" volumes_from: - app mysql: image: mysql:5.7 volumes_from: - app expose: - "3306" restart: always environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: app MYSQL_USER: root MYSQL_PASSWORD: root memcached: image: memcached ports: - "11211:11211"

在workspace / Dockerfile中我有来自github image 6.6.30fpm的所有字符串 然后我在这个文件夹里面 docker-compose构建工作区

在此工作区之前我有另一个设置

FROM ubuntu:14.04

ENV DEBIAN_FRONTEND noninteractive

RUN \
  sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
  apt-get update && \
  apt-get -y upgrade && \
  apt-get install -y build-essential && \
  apt-get install -y software-properties-common && \
  apt-get install -y byobu curl git htop man unzip vim wget nano locate

RUN apt-get update --fix-missing --allow-unauthenticated
RUN apt-get install -y --allow-unauthenticated libmcrypt-dev libxml2-dev mysql-client
RUN apt-get update -y --allow-unauthenticated && apt-get upgrade -y --allow-unauthenticated && apt-get install -q -y php5 php5-dev php5-fpm php5-mysqlnd php5-mcrypt

RUN echo "extension=/usr/lib/php5/20121212/mcrypt.so" > /etc/php5/mods-available/mcrypt.ini \
    && ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/cli/conf.d/20-mcrypt.ini  
RUN curl -sS https://getcomposer.org/installer | php  
RUN mv composer.phar /usr/local/bin/composer

WORKDIR /var/www/html

# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

这可以,但我想5.6.30而不是5.5.9

1 个答案:

答案 0 :(得分:0)

也许是因为没有执行权限。 试试

chmod +x docker-php-*

<强> UPD: 只需将all these files放在目录中,使用php 5.6 Dockerfile

如果你想使用php 7.2版本,this link is for you

无论如何其他googlers。只需探索this repository,您就会发现自己想要的。 :)