How to tag docker image with docker-compose

后端 未结 4 1821
清歌不尽
清歌不尽 2020-12-04 11:42

I want to build image via docker-compose and set specific tag to it. Documentation says:

Compose will build and tag it with a generated name, and use

4条回答
  •  醉酒成梦
    2020-12-04 12:26

    If you specify image as well as build, then Compose names the built image with the webapp and optional tag specified in image:

    build: ./dir
    image: webapp:tag
    

    This results in an image named webapp and tagged tag, built from ./dir.

    https://docs.docker.com/compose/compose-file/#build

提交回复
热议问题