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 docker build on release #888

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

insidieux
Copy link
Contributor

  • Add Dockerfile
  • Add GitHub workflow running on release published event

Dockerfile Outdated Show resolved Hide resolved
@jamietanna
Copy link
Member

What are your thoughts, @deepmap-marcinr? Not sure if this fits within your thoughts about what we'd want to maintain in this project, but looks like a few folks are interested in it.

@deepmap-marcinr
Copy link
Contributor

What's the reasoning behind this? To docker run oapi-codegen instead of using go install to get it?

@insidieux
Copy link
Contributor Author

insidieux commented Dec 17, 2022

What's the reasoning behind this? To docker run oapi-codegen instead of using go install to get it?

For example to use it in CI, as docker image for stage.
Also i don't need to control and check what the version is currently installed, just use docker image with tag I need.

@insidieux
Copy link
Contributor Author

So? Any updates?
If you are struggle to prevent providing Dockerfile and image, I can just make my project with dependabot and reference to yours repo)
Imho, project could be fully self-maintained and let users more convenient service of usage)

@deepmap-marcinr
Copy link
Contributor

How is this going to look like in terms of releases to ghcr or docker hub or whatever? It looks like it's automatic whenever I push a release - but now, I have to worry about exceeding storage or access quotas, because people will complain when this fails.

I'm open to doing something like this, the process with github actions looks simple, but I think maybe I'd need to push it to dockerhub after setting up my own account there. Is there any particular reason to use one over the other? I've only ever consumed from public docker repositories, never produced.

@insidieux
Copy link
Contributor Author

How is this going to look like in terms of releases to ghcr or docker hub or whatever? It looks like it's automatic whenever I push a release - but now, I have to worry about exceeding storage or access quotas, because people will complain when this fails.

I'm open to doing something like this, the process with github actions looks simple, but I think maybe I'd need to push it to dockerhub after setting up my own account there. Is there any particular reason to use one over the other? I've only ever consumed from public docker repositories, never produced.

Depends on you want to use =) I can provide Action for push to Dockerhub, if you want =) And there is cool feature Automated builds in Dockerhub, but it works only for paid accounts.

- Add Dockerfile
- Add GitHub workflow
@Mxrk
Copy link

Mxrk commented May 19, 2023

Any updates here? Would like to see it happening.

@DrBlury
Copy link

DrBlury commented May 19, 2023

I'd like to see an update here as well. Having a docker image drastically improves adoption. For some companies/developers it's a no-go if they have to check out a repo or install something in a not so streamline way. Docker helps with that. All the cli tools you want/need can be just inside containers and don't bloat the host system. They can be easily removed as well and using other versions of the software doesn't require and weird procedures. Just changing the version tag.

@insidieux
Copy link
Contributor Author

So? Seems like not only me ask for this feature =) But 6 months passed from first push...
Any updates? Or I must to create just side project with dependabot automation and custom image?

@deepmap-marcinr
Copy link
Contributor

deepmap-marcinr commented Jun 6, 2023

I am happy to merge the Dockerfile and Makefile changes to produce a container image, however, I'm in a tight spot with where to host this docker image.

Deepmap got acquired by a large company which has all kinds of licensing requirements and internal requirements around shipping binaries, because it opens us up to liability in case we accidentally ship a virus or malware or something. I'm no longer in a position where I have the authority to make these decisions.

So, could I propose that we commit the build into this repository, but not the action hook which publishes it? Then, maybe someone who doesn't have these constraints can publish an image. I can link to it in the readme, but mention that it's not supported.

@jamietanna
Copy link
Member

Hey @deepmap-marcinr is it right that we're maybe in a state we may need to close this as a "can't do, legally"?

Dockerfile Outdated
Comment on lines 1 to 2
ARG GO_VERSION=1.18
ARG ALPINE_VERSION=3.16
Copy link
Member

Choose a reason for hiding this comment

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

These will need a change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, set go version according to go.mod and up alpine version

Dockerfile Outdated
RUN addgroup -S oapi-codegen && adduser -S oapi-codegen -G oapi-codegen

### Image
FROM scratch as image
Copy link
Member

Choose a reason for hiding this comment

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

Alternatively we could use Chainguard's lightweight undistro images

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest, i've never used Chainguard's undistro images...
I made a change: added possibility to change base image when we want on build.

Copy link
Member

@jamietanna jamietanna left a comment

Choose a reason for hiding this comment

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

Just awaiting Marcin's thoughts, after which we can look at some follow up changes

[feat] Update alpine version
[feat] Add possibility to change base image
@DrBlury
Copy link

DrBlury commented Mar 26, 2024

What's the status here? I would really like this to be merged

@jamietanna
Copy link
Member

Hey folks, I've opened this page a couple of times recently to draft a reply.

The short answer is, nothing yet - there's some behind the scenes stuff which hopefully should make this progress, but until then, Marcin's comment above still holds about us not being able to serve the image.

Am eagerly hoping to have an answer for this before long!

@jamietanna
Copy link
Member

Just a quick x-post of #937 (comment) here as it's a fairly similar change and is worthwhile us considering a bit more

@jamietanna
Copy link
Member

One thing I also want us to make sure we think about with this is how we'll respond to CVEs in the underlying container (i.e. I don't want to have to have folks chasing us for "hey there's a completely unrelated CVE in the container, please fix")

@DrBlury
Copy link

DrBlury commented Jul 4, 2024

A FROM SCRATCH image could be used with just the built go binary. Then there are no such CVEs, correct?

@jamietanna
Copy link
Member

Correct yes, so chances are this proposal would avoid the CVE concerns, as we'd distribute FROM scratch 👍🏼

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.

None yet

6 participants