Hi,
Want to check if there is a docker image/Dockerfile for protobuf which is officially supported? I could not find one under dockerhub official images https://hub.docker.com/explore/
If not, want to check if there is any plan to add an official protobuf image to dockerhub? https://docs.docker.com/docker-hub/official_repos/#how-do-i-create-a-new-official-repository
What's your planned use of this image?
My interest right now is to first check if it makes sense to have protobuf as a docker official image (steps for doing the same are in the link posted in my previous comment, it also mentions the considerations for making an image official)
If that happens, the image comes under Docker's "official" image program, they then take over the daily builds etc, it gets published under https://hub.docker.com/explore/ - however the maintainence is to be done by upstream
Also the image can also be made multi-arch (for platforms it supports) via Docker's multi-arch framework
If user want to use other software together with protobuf, do they write additional docker file based on the proposed protobuf image? Or there is some easy way to combine different docker image? (e.g., if user want to use both python and protobuf, he just combine python official image and protobuf official image)
I guess having a single dockerfile with compilers for the different languages installed may be a better option? I am not sure/aware of combining different docker images (the way you mentioned, kubernetes may be an option but not sure)
This is a github repo which dockerizes protobuf in a single dockerfile https://github.com/znly/docker-protobuf , maybe could do something similar
@TeBoring if you want to use different software you can compose them together via docker-compose. So for your example it would look something like:
version: '3.4'
services:
python:
image: python
volumes:
...
protobuf:
image: google/protobuf
volumes:
....
@yunspace What if the images are compatible?
@yunspace Sorry, I meant to ask what if the images are not compatible...
@xfxyjwf sorry I'm not sure what you mean. Not compatible with what?
In the above example you use python to build python and you use protobuf to build protobuf. It's basic composition over inheritance. If the official images aren't sufficient, you can always create your own images, such as xfxyjwf/protobuf. I have a full example here: https://github.com/serverlesscloud/musketeers-lambda-go-sls/blob/master/docker-compose.yml
If user want to use other software together with protobuf, do they write additional docker file based on the proposed protobuf image? Or there is some easy way to combine different docker image? (e.g., if user want to use both python and protobuf, he just combine python official image and protobuf official image)
protoc is more or less just a binary (to users). The images would presumably just be the base images (ubuntu:16.04, alpine:3.8, etc.) with the appropriate protoc release added, and possibly the well-known types in /usr/local/include or similar.
This actually would be really useful. Not only would it be a way to handle running protoc, but for those of us that need to expose a Docker image that somehow uses protoc under the hood, we could reference it in a multi-stage build:
COPY --from gcr.io/protobuf/protobuf:3.6.1 /usr/local/bin/protoc /usr/local/bin/protoc
...and then you add _only_ the size of the executable to your Docker image.
@lukebakken's proposal makes more sense to me. I think users should base on central repositories (e.g., apt-get or maven) to install protoc. Because Docker can only inherit from one base Dokerfile, if users have different combination of software to use, providing a Dock image for protoc alone doesn't work.
Most helpful comment
protocis more or less just a binary (to users). The images would presumably just be the base images (ubuntu:16.04, alpine:3.8, etc.) with the appropriate protoc release added, and possibly the well-known types in/usr/local/includeor similar.This actually would be really useful. Not only would it be a way to handle running protoc, but for those of us that need to expose a Docker image that somehow uses protoc under the hood, we could reference it in a multi-stage build:
...and then you add _only_ the size of the executable to your Docker image.