go-enum icon indicating copy to clipboard operation
go-enum copied to clipboard

Docker image with go-enum

Open tarampampam opened this issue 3 years ago • 12 comments

Could you please provide an "official" multi-arch docker image to use this tool? It can be simply deployed to the ghcr.io, for example. Use case - a more simple installation in the docker context, like:

COPY --from=abice/go-enum:v0.5.5 /usr/local/bin/go-enum /bin/go-enum

If you need help with it, I can make a PR with the required changes.

tarampampam avatar Jan 30 '23 12:01 tarampampam

Sounds like a reasonable request... I'll see what I can do

abice avatar Jan 30 '23 15:01 abice

Just as an example (it can be helpful to you)

tarampampam avatar Jan 30 '23 15:01 tarampampam

@abice Any news on it?

tarampampam avatar Feb 09 '23 20:02 tarampampam

Haven't had time to work on it, sorry!

abice avatar Feb 09 '23 20:02 abice

Oh... I'm waiting for it very much :(

tarampampam avatar Feb 09 '23 20:02 tarampampam

Same for me! I can contribute if necessary, @abice. Just give me a shout. :relieved:

ccamel avatar Nov 07 '23 15:11 ccamel

~I've added a docker image... abice/go-enum:0.5.9 as the starting point.~

~Please let me know if there are any issues using the image, thanks!~

This is not working yet... still working out the bugs 😄 sorry!

And just for everyone's information, apparently despite the fact that I imported the goimports tool, it actually makes a call to the go binary for at least getting the go environment information. I'm not sure how I want to get around this at the moment, and will take a sec to figure that out. Sorry about getting your hopes up 😞

abice avatar Nov 13 '23 14:11 abice

Alright, so I'm going to leave this ticket open as a reminder that I need to figure out how to run the go-enum binary without the go binary installed (or at least a smaller image to do so)... but for now, you can use the image abice/go-enum:0.5.10 successfully.

I've updated some of my makefiles to look like this, and they successfully generate the enums correctly.

GOENUM = docker run -w /app -v $(shell pwd):/app abice/go-enum:$(GOENUM_VERSION)
GOENUM_VERSION=0.5.10

%_enum.go: %.go go.sum
	$(GOENUM) -f $*.go $(GO_ENUM_FLAGS)

If anyone has an idea of how to get the go-enum binary to do the goimports functionality without executing a go binary, I'm open to suggestions!

abice avatar Nov 13 '23 17:11 abice