dnephin / dobi

A build automation tool for Docker applications
https://dnephin.github.io/dobi/
Apache License 2.0
311 stars 36 forks source link

Add task `:build` to compose resources #119

Closed OnkelTem closed 6 years ago

OnkelTem commented 6 years ago

Please add a task to build compose resources used in dobi.yaml.

Docker compose itself never rebuilds its images so if you develop images you have to manually rebuild them which involves:

i.e.

$ docker-compose -f docker-compose.service-name.yml -p project-name build

Needless to say that if you mistype something or forget to provide project name you have pretty good chances to run into real problems with images versioning.

And all that could be replaced by just:

$ dobi service-name:build

ALSO

Using this task we could write special aliases in dobi.yaml for building all the images as a preparation step before running jobs, e.g;

job=build:
  tasks: [job1-image, job2-image, compose1:build, compose2:build]

This is especially important as images fetching/building takes a lot of time (tens of minutes or more) during which you basically sit and wait. So it's reasonable to separate steps of building and running.

dnephin commented 6 years ago

Image should be built as dobi image resources, not from the compose file. I do not want to support building with docker-compose.

OnkelTem commented 6 years ago

Image should be built as dobi image resources, not from the compose file. I do not want to support building with docker-compose.

What do you mean "support with docker-compose"? Is it in some way difficult to do it or what? You already run docker-compose up, do you? So what's wrong with adding more such things? Or do you mean that you don't want to make Dobi better?

dnephin commented 6 years ago

What do you mean "support with docker-compose"?

There is already a way to build images, it is the dobi image resource. There's no reason to build using docker-compose build.

I don't want to make it worse. Having two different ways to do the same thing makes it worse.

The better way to build images is to make dobi image resources.

airtonix commented 4 years ago

@OnkelTem , @dnephin is right.

Before you used dobi, you were most likely using docker-compose to facilitate at least two things:

Long ago, I stopped using docker-compose to build my images because it didn't provide enough control over how the built images are named.

So, now that you're using dobi, you don't need to use the docker-compose build directive. simply specify image instead, and make dobi build the images to match.

Dobi provides more control over how your built images are named, which will give you more options in CI and your local development without overcomplicating the CLI interface for your fellow team members.