official-images
                                
                                
                                
                                    official-images copied to clipboard
                            
                            
                            
                        Add Grafana image
Checklist for Review
NOTE: This checklist is intended for the use of the Official Images maintainers both to track the status of your PR and to help inform you and others of where we're at. As such, please leave the "checking" of items to the repository maintainers. If there is a point below for which you would like to provide additional information or note completion, please do so by commenting on the PR. Thanks! (and thanks for staying patient with us :heart:)
- [x] associated with or contacted upstream?
 - [x] does it fit into one of the common categories? ("service", "language stack", "base distribution")
 - [x] is it reasonably popular, or does it solve a particular use case well? Top 90 most popular project on GitHub
 - [ ] does a documentation PR exist? (should be reviewed and merged at roughly the same time so that we don't have an empty image page on the Hub for very long)
 - [ ] official-images maintainer dockerization review for best practices and cache gotchas/improvements (ala the official review guidelines)?
 - [ ] 2+ official-images maintainer dockerization review?
 - [x] existing official images have been considered as a base? (ie, if 
foobarneeds Node.js, hasFROM node:...instead of grabbingnodevia other means been considered?) - [ ] if 
FROM scratch, tarballs only exist in a single commit within the associated history? - [ ] passes current tests? any simple new tests that might be appropriate to add? (https://github.com/docker-library/official-images/tree/master/test)
 
This image is similar to how elasticsearch/kibana is configured in that it's basing the image on our upstream image. This is preferable as the image publish step is after a long build & integration test process that validates the image & build, so would be good to just re-use the same image. https://github.com/grafana/grafana-docker-official
The upstream Dockerfile is at: https://github.com/grafana/grafana/blob/main/packaging/docker/Dockerfile
This image is similar to how elasticsearch/kibana is configured in that it's basing the image on our upstream image.
Unfortunately, the way the ELK images are currently structured was a one-time special case (and was only approved after a lot of back and forth and adjustments on both sides), and frankly it has gone very poorly. We do not plan to approve such a special case again.
@tianon so if the Dockerfile instead downloads and installs a built tar.gz package is that ok?
So it would be basically this Dockerfile: https://github.com/grafana/grafana/blob/main/packaging/docker/Dockerfile
It currently relies on the build providing the built package in a prior step, if we replace that with a download & verification instead is that ok?
Yes, that approach is generally OK (you'll want to note #10794 and https://github.com/docker-library/faq#multi-stage-builds). :+1:
I don't necessarily expect you to use any of it, but you might also find some parts of https://github.com/tianon/dockerfiles/blob/8356f896bbda16bf9e401dbaf2634c5880c6f88d/grafana/Dockerfile useful or interesting. :innocent:
(It's not super well-maintained/untouched since 2018 because I don't actually use that image anymore, but it's an OK example of the expected approach with a bit of software that's likely familiar. :smile:)