Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a multi-stage Dockerfile #871

Merged
merged 1 commit into from
Mar 1, 2019
Merged

Conversation

sylr
Copy link
Contributor

@sylr sylr commented Feb 27, 2019

This makes it easy to build a thanos image without a proper dev env set up.

Also allows to build images using quay.io or docker hub services.

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we replace existing docker with this for clean view? (:

@sylr
Copy link
Contributor Author

sylr commented Feb 28, 2019

We absolutely can but each time I tried to propose this I got "we prefer to build it outside docker and package it afterward"

@bwplotka
Copy link
Member

Ah, my bad did not look closer.

So I think this is quite useful and keeping it here seems ok as well. We have 2 options. Leave 2 Dockerfiles, but worth to name them better? For example Dockerfile (for the thing we have now) and Dockerfile_dev.multi-step for this one?

Otherwise we can do single multi stage with 3 images. 2 as you created, and 3rd with just copy without --from so what we have right now. Then we can name all 3 and run docker build with proper --target (: What do you think? From our point of view we used it with Makefile and CI only, so as long as make docker and make docker-push works, we are fine. But we would like to keep simple copy pattern, and allow full build+copy as optional thing.

@sylr
Copy link
Contributor Author

sylr commented Feb 28, 2019

I don't understand the purpose of a multi stage Dockerfile if the last stage does not copy the build results of the previous stages.

As for the name I'd keep it like that I don't like the _dev addition and it's really name multi-stage builds not multi-step.

@bwplotka
Copy link
Member

Sure, let's do that (: So maybe at least make docker-multi-stage will be useful then?

@bwplotka
Copy link
Member

I don't understand the purpose of a multi stage Dockerfile if the last stage does not copy the build results of the previous stages.

Some of them has, rest you can explicitly run using --target, but I agree it might super confusing idea I proposed (:

@sylr
Copy link
Contributor Author

sylr commented Feb 28, 2019

Sure, let's do that (: So maybe at least make docker-multi-stage will be useful then?

That I can do.

Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>
@bwplotka bwplotka merged commit 0bb6590 into thanos-io:master Mar 1, 2019
@bwplotka
Copy link
Member

bwplotka commented Mar 1, 2019

Thanks! Awesome.

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

Successfully merging this pull request may close these issues.

2 participants