-1

我可以使用 php 容器从其他容器执行脚本吗?如果可以,我该怎么做或我做错了什么

Dockerfile:

来自 ubuntu:14.04

运行 apt-get update && apt-get install -y apache2

添加 docker/apache2/apache-config.conf /etc/apache2/sites-enabled/000-default.conf

添加 docker/hosts /etc/hosts

CMD /usr/sbin/apache2ctl -D FOREGROUND

图:

app:
    build: .
    volumes:
      - .:/var/www/
    ports:
      - "80:80"
    links:
       - php
php:
    image: php:5.6
    volumes:
      - .:/var/www/
4

1 回答 1

0

我不确定您要做什么,但是如果您想将 PHP 与 Apache 一起运行,则图像php:5.6-apache可能更合适(请参阅:https ://registry.hub.docker.com/u/library/php/ )

在这种情况下,您将只有 1 个容器(无链接)。

于 2015-03-11T11:52:14.660 回答