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

Docker image with go-enum #171

Open
tarampampam opened this issue Jan 30, 2023 · 8 comments
Open

Docker image with go-enum #171

tarampampam opened this issue Jan 30, 2023 · 8 comments

Comments

@tarampampam
Copy link

tarampampam commented Jan 30, 2023

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.

@abice
Copy link
Owner

abice commented Jan 30, 2023

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

@tarampampam
Copy link
Author

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

@tarampampam
Copy link
Author

@abice Any news on it?

@abice
Copy link
Owner

abice commented Feb 9, 2023

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

@tarampampam
Copy link
Author

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

@ccamel
Copy link

ccamel commented Nov 7, 2023

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

@abice
Copy link
Owner

abice commented Nov 13, 2023

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
Copy link
Owner

abice commented Nov 13, 2023

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!

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

No branches or pull requests

3 participants