简体   繁体   English

运送多容器 Docker 应用程序

[英]Shipping multi-container Docker app

I've recently been using Docker and researching about how one might ship a dockerized application.我最近一直在使用 Docker 并研究如何发布一个 dockerized 应用程序。 If everything was stored in one container (ex: Tomcat, webapp, MySql), it would seem easy to send someone one .tar of the image for them to run.如果所有内容都存储在一个容器中(例如:Tomcat、webapp、MySql),那么向某人发送一个 .tar 映像供他们运行似乎很容易。 However, most people have been saying to separate your database from your application.但是,大多数人一直在说要将数据库与应用程序分开。 So if I wanted to ship an application that required multiple containers, what would be the best method to do so?因此,如果我想发布一个需要多个容器的应用程序,那么最好的方法是什么?

Check out docker compose.查看 docker compose。 It is designed to specify, spin up, and link multiple containers together.它旨在指定、启动和链接多个容器。

He is an example config listed on the front page:他是首页上列出的示例配置:

web:
  build: .
  ports:
   - "5000:5000"
  volumes:
   - .:/code
  links:
   - redis
redis:
  image: redis

https://docs.docker.com/compose/ https://docs.docker.com/compose/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM