wireservice / csvkit

A suite of utilities for converting to and working with CSV, the king of tabular file formats.
https://csvkit.readthedocs.io
MIT License
5.9k stars 605 forks source link

Containerize / Dockerize csvkit #1240

Open wesley-dean-flexion opened 2 months ago

wesley-dean-flexion commented 2 months ago

In #1239 I mentioned my work with MegaLinter. MegaLinter, in addition to supporting installs via npm, pip, etc., can also work with container images. A quick search on DockerHub seems to indicate that some folks have rolled their own csvkit images but it doesn't look like anything's being automatically generated. For example, I see that v1.5.0 is the most recent release (March 28, 2024) while the most recent image (on the first page of results on) DockerHub appears to be May 2nd, 2023 (almost a year ago).

So, babbling on, I've a workflow that I use to build and push images to GHCR, DockerHub, and Quay (all are optional) for several architectures (AMD64, ARM64, etc.):

https://github.com/wesley-dean-flexion/upload-sarif-to-defectdojo/blob/main/.github/workflows/publish.yml

The workflow is triggered by commits to main (configurable) updating the :edge tag of the images and GitHub releases triggering updates to :latest, versioned tags (e.g., v1, v1.5, and v1.5.0 in this case), etc..

If it would be helpful, I would be happy to submit a PR with it setup along with a Dockerfile to streamline the image build process.

If this isn't something that's interesting to you, that's totally cool. I don't want to make any more work for you than you've already got.

Thanks again!

jpmckinney commented 2 months ago

Could you start with authoring the Dockerfile?

My workflow would tend to be much simpler e.g. adding a condition to only run on tags to this workflow: https://ocp-software-handbook.readthedocs.io/en/latest/docker/build.html

wesley-dean-flexion commented 2 months ago

I would be happy to do so. I'll have a PR for you fairly shortly.

wesley-dean-flexion commented 2 months ago

I've a Dockerfile builds an image that clocks in at 135MB with the v2.0.0 release. I just need to fork and create a PR.

wesley-dean-flexion commented 1 month ago

I'll be adding another PR to incorporate publishing the images in the next few days.

wesley-dean-flexion commented 1 month ago

@jpmckinney I added #1245 as a draft PR as #1240 needs to be merged first (#1245 includes a Dockerfile that's defined in #1240). I'm happy to walk through the PR and the configuration mentioned there if that's helpful.

No rush. Never a rush.

jpmckinney commented 1 month ago

Thank you! I'll take a look through once I have a moment.