Skip to content

Small size docker image refactoring#649

Merged
discordianfish merged 1 commit intoprometheus:masterfrom
sdurrheimer:master
Apr 24, 2015
Merged

Small size docker image refactoring#649
discordianfish merged 1 commit intoprometheus:masterfrom
sdurrheimer:master

Conversation

@sdurrheimer
Copy link
Copy Markdown
Contributor

Hi

As asked in #636, here the PR with my small size docker image refactoring.
prometheus_small_size_docker_image

This is a breaking change and will affect people having extended the prom/prometheus image for the following reasons :

  • Switching from the way to heavy golang base image (debian:jessie) to alpine:edge.
    I used the edge tag of alpine base image because of golang version. In alpine:3.1, golang version is 1.3.3. In alpine:edge, it's 1.4.2. Later on, we will be able to change to alpine:3.2 when it released.
  • /go/src/github.com/prometheus/prometheus/console_libraries and /go/src/github.com/prometheus/prometheus/consoles folders moved to /etc/prometheus
  • /prometheus.conf file moved to /etc/prometheus too.

In this case, there is maybe some way of limiting the impact by pushing the current image as a new tag on docker hub. Therefore, people will be able to make the transition easily.

A PR will follow for the https://github.com/prometheus/docs repository.

Moreover, I will give a try on reducing docker image size of available exporters.

@discordianfish @juliusv

Signed-off-by: Steve Durrheimer <[email protected]>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think /etc/prometheus should be a volume: People can bind-mount that anyway and if they don't want to use a volume for the config (which I would actually suggest to do) they have no way to prevent this from being a volume.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, I had some hesitation about that. I will make the modification soon, and squash it in the first commit if you want to.

@discordianfish
Copy link
Copy Markdown
Member

If we were starting from a clean slate, I would fully agree with this PR. Since don't, I'm not sure we should move the console stuff and prometheus config.
There is no need for that, right? I agree that given the split of build and runtime deps the new paths make somewhat more sense but I'm not sure it's worth breaking people's images.
Then again, switching to alpine breaks stuff anyways so it might be okay. Would be great to get some more input before deciding.

@sdurrheimer
Copy link
Copy Markdown
Contributor Author

I moved consoles and consoles_libraries folders because of rm -rf /go. This save more space, since prometheus is build as /bin/prometheus. /etc/prometheus was a natural destination for me.

Then I moved /prometheus.conf in /etc/prometheus in order to be consistent. For me, it was odd to have /prometheus.conf and /etc/prometheus.

But I agree, this change breaks people images even if they only add prometheus.conf file (like docs example)

@discordianfish
Copy link
Copy Markdown
Member

Well we could still move things back after the rm -rf /go. But I tend towards just breaking downsteam. Providing Docker images and have people 'customize' them is a really new things and given that Docker doesn't provide any kind of contract, people simply can't expect the parent image to be stable.
Since it will break next time someone tries to build their image (not deploying) the impact of this breaking change isn't that big.
So I'd 👍 on this PR but would still be interested what others think. @juliusv: I know you don't use Docker, but how do you feel about that in general?

@juliusv
Copy link
Copy Markdown
Member

juliusv commented Apr 24, 2015

@discordianfish I think this depends in part on the culture, expectations, and "best practices" in Docker-land, so I'll trust your judgement here.

discordianfish added a commit that referenced this pull request Apr 24, 2015
Small size docker image refactoring
@discordianfish discordianfish merged commit 2bb3efc into prometheus:master Apr 24, 2015
@discordianfish
Copy link
Copy Markdown
Member

Well then :). Thanks a lot @sdurrheimer!

juliusv added a commit to prometheus/docs that referenced this pull request Apr 24, 2015
Updated doc for prometheus/prometheus#649 docker image refactoring PR
@thefallentree
Copy link
Copy Markdown

+1 !!

codesome pushed a commit to codesome/prometheus that referenced this pull request Jul 29, 2019
wal: Inject LiveReader metrics rather than registry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants