我遇到了一些 docker ,发现 tianon/true
在我的 docker 文件中使用的图像。
我的 docker-compose.yml 文件如下所示:
app:
image: mageinferno/magento2-nginx:1.11-1
links:
- phpfpm
- db
volumes_from:
- appdata
ports:
- 8000:80
env_file: env/nginx.env
appdata:
image: tianon/true
volumes:
- /var/www/html
- ~/.composer:/var/www/.composer
- ./html/app/code:/home/gujarat/php/html/app/code
- ./html/app/design:/home/gujarat/php/html/app/design
- ./html/app/etc:/var/www/html/app/etc
- ./html/downloads:/var/www/html/downloads
phpfpm:
image: mageinferno/magento2-php:7.0-fpm-1
links:
- db
- mail
volumes_from:
- appdata
db:
image: percona:5.7
volumes_from:
- dbdata
ports:
- 8001:3306
env_file: env/mysql.env
dbdata:
image: tianon/true
volumes:
- /var/lib/mysql
setup:
image: mageinferno/magento2-php:7.0-fpm-1
command: /usr/local/bin/mage-setup
links:
- db
volumes_from:
- appdata
env_file: env/setup.env
appdata
现在我明白每个容器都需要一个图像。
在这种情况下 appdata
是一个仅指向某些目录的容器,它将在另一个 docker 容器中使用。
appdata:
image: tianon/true # Here is the image, if we remove it, it won't work.
volumes:
- /var/www/html
- ~/.composer:/var/www/.composer
- ./html/app/code:/home/gujarat/php/html/app/code
- ./html/app/design:/home/gujarat/php/html/app/design
- ./html/app/etc:/var/www/html/app/etc
- ./html/downloads:/var/www/html/downloads
所以在我的 docker-compose.yml
在它上面需要一个非常小的docker镜像。那就是tianon/true
.如果我们选择另一个大的 docker 镜像会浪费资源。125 bytes total - nothing but "true" (perfect for volume-only containers) Yes, those are "regular bytes" - static assembly for the win.
关于docker - tianon/true 在 Dockerfile 中有什么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45074303/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |