docker compose build single container

后端 未结 4 1200
我在风中等你
我在风中等你 2021-01-30 05:51

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

> docker-compose build
Building elasticsearch         


        
相关标签:
4条回答
  • 2021-01-30 06:27

    Yes, use the name of the service:

    docker-compose build elasticsearch
    
    0 讨论(0)
  • 2021-01-30 06:31
    docker-compose up -d --no-deps --build <service_name>
    

    Source

    0 讨论(0)
  • 2021-01-30 06:32

    if you want to run and recreate a specific service inside your docker-compose file you can do it the same way as @dnephin proposed, like

    $ docker-compose up -d --force-recreate --no-deps --build service_name
    

    Suppose your docker-compose.yml file is like

    version: '3'
    services:
      service_1:
          .....
      service_2:
          .....
    
    0 讨论(0)
  • 2021-01-30 06:38

    You have do do it manually using image tag. More details here.

    0 讨论(0)
提交回复
热议问题