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

Added a Dockerfile #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ElectricWarr
Copy link

Added a Dockerfile in trying out minica in my environment, so I thought I'd share 🙂

This runs the go build process in a Go container, and produces a small (<4MB on my system) image.

To build:

docker build --tag=minica:1.0 .

To run:

docker run --rm -it --name=minica minica:1.0

With this minica could be distributed via Docker Hub, eg. as jsha/minica.

@jsha
Copy link
Owner

jsha commented Nov 12, 2019

Thanks for the contribution! And my apologies for not getting back to you sooner.

I'm curious about the use case for this. Minica is quite small and doesn't have any environment dependencies once built. To build it you need Go, but for that use case I think it makes more sense to distribute as a binary rather than a Docker image. What are the advantages of a Docker image instead?

/cc @DanielVartanov @willfarrell @jbauers @zacfi since you thumbsed-up this.

@Acen
Copy link

Acen commented Nov 12, 2019

Sorry, used a work account. @zacfi

I wouldn't say instead of a binary, but in addition to. Removing the need for someone working in a docker-environment (kubernetes etc) to build it in the first place.

A lot of open-source software use it as a good example running their software as a micro-service.

Plus docker hub provides free builds for open source. So once the dockerfile is written, the most recent version will be built as needed with a history log onto docker hub without maintenance necessary. Ultimately just expanding the social-footprint of the project.

Our use case (for the few hours we were looking at using minica, RIP work project) we'd have thrown the image into a testing kubernetes cluster and see how it can work right away, rather than needing to do the local probing before managing the build at all.
Saying that the needs of the package itself are pretty small, so would be a few line docker file anyway.

Yolo, docker is the future.

@ElectricWarr
Copy link
Author

What are the advantages of a Docker image instead?

I didn't intend this to replace anything - it's as I said on the first line, in my own environment I needed a Dockerfile to try Minica out, and including it here would give others in similar situations a leg-up.

IMO just having the Dockerfile is enough, and you don't even need to build and distribute a Docker Image - but once Actions is up and running, you... may as well?

What are the advantages of supplying a Dockerfile alongside my source code?

Go wasn't installed on the machine I was working on, and since I don't regularly develop in Go it's nice to keep everything contained.

This provides absolutely anyone [who can run Linux containers] with a valid build environment that you define, and an alternative way to show Minica's dependencies.

@fopina
Copy link

fopina commented May 16, 2020

just to add something, I think Dockerfiles are nice to build, but one really nice thing is distribution.

Even if it's a single binary (resulting in a FROM scratch ADD binary), being able to run minica in a new machine by simply typing docker run jsha/minica is way easier/faster than:

  • googleminica
  • open github/repo/releases (which none is available at the moment either)
  • spend some time thinking where to place the binary in the new machine
  • wget/curl the release

:)

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