Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

If build is used in docker-compose then image: can be omitted #8

Open
030 opened this issue Apr 9, 2019 · 2 comments
Open

If build is used in docker-compose then image: can be omitted #8

030 opened this issue Apr 9, 2019 · 2 comments

Comments

@030
Copy link

030 commented Apr 9, 2019

If build: is used in docker-compose then image: can be omitted

@bahmutov
Copy link
Contributor

You mean

services:
  web:
    image: apache
    build: ./webapp
	...
  e2e:
    image: cypress
    build: ./e2e

image is Docker image, and build if the folder, no?

@sidewaysgravity
Copy link

If you specify both, then it will build an image using the build context specified and name/tag it according to the image name. It's fine to have both.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants