2016-02-05 62 views
11

使用撰写,如果运行docker-compose build,它会重建所有容器:搬运工组成建立单一容器

> docker-compose build 
Building elasticsearch 
Step 1 : FROM elasticsearch:2.1 
---> a05cc7ed3f32 
Step 2 : RUN /usr/share/elasticsearch/bin/plugin install analysis-phonetic 
---> Using cache 
---> ec07bbdb8a18 
Successfully built ec07bbdb8a18 
Building search 
Step 1 : FROM php:5.5.28-fpm 
---> fcd24d1058c0 
... 

使用缓存重建即使,这需要时间。所以我的问题是:

有没有办法只重建一个特定的容器?

回答

29

是,使用该服务的名称:

docker-compose build elasticsearch 
0

你必须手动使用图像标签来做。更多详情here