最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

docker-compose build components before start - Stack Overflow

programmeradmin0浏览0评论

Currently we start components from docker-compose.yml file. In local we bring up always latest image for testing.

my sample docker-compose.yml file:

name: test.  #Project name

services:
  component1:           
    image: quay.io/testrd/com-test-component1:latest
    ports:
      - 8181:8080
    environment:
      - DB_HOST=localhost
      - DB_PORT=3306

component2:
    image: quay.io/testrd/com-test-component2:latest
    ports:
      - 8282:8080
    environment:
      - DB_HOST=localhost
      - DB_PORT=3306

my requirement is to build these components before starting them. I have a gradle build target in each component "gradlew buildDocker", need to call this target.

I see there is a 'build' property in docker-compose, but do not know how to apply it for my requirement, i could not find many examples for it.

Each component located in different folders.

发布评论

评论列表(0)

  1. 暂无评论