osx - Docker for Mac Beta: Unable to link containers properly -
i have tried linking 2 containers , executing commands valid on 1 other works in docker toolbox version of tool.
copy of yml file:
version: '2' services: nginx: image: nginx:latest hostname: nginx links: - php ports: - "8000:80" privileged: true php: image: php:5-fpm hostname: php privileged: true
i expect able log onto nginx container , able execute php i.e. php -version.
docker exec -it test2_nginx_1 bash root@nginx:/# ping php ping php (172.19.0.2): 56 data bytes 64 bytes 172.19.0.2: icmp_seq=0 ttl=64 time=0.103 ms 64 bytes 172.19.0.2: icmp_seq=1 ttl=64 time=0.089 ms
ping works!
root@nginx:/# php -version bash: php: command not found
this not work.
logging on php container:
docker exec -it test2_php_1 bash root@php:/var/www/html# php -version php 5.6.22 (cli) (built: jun 8 2016 17:49:08) copyright (c) 1997-2016 php group zend engine v2.6.0, copyright (c) 1998-2016 zend technologies
why not able execute on linked container?
why not able execute on linked container?
because "linking" (or, since docker 1.10, common network), communication, not programs.
your nginx
container individual machine on php never installed. can ping php
container, not locally execute installed only on said php
machine.
Comments
Post a Comment