docker撰写构建单个容器 [英] docker compose build single container

查看:86
本文介绍了docker撰写构建单个容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Compose,如果我运行 docker-compose build ,它将重建所有容器:

Using Compose, if I run docker-compose build, it will rebuild all the containers :

> 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
...

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

Even when rebuilding using cache, this takes time. So my question is:

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

推荐答案

是,请使用服务名称:

docker-compose build elasticsearch

这篇关于docker撰写构建单个容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆