Add CI/CD for building and pushing docker image to the public registry on release #114
-
Is your feature request related to a problem? Please describe. Describe the solution you'd like |
Beta Was this translation helpful? Give feedback.
Replies: 17 comments
-
@safaci2000 Hello! Please review my issue and PR. Also, before the merge, you should create a DockerHub registry and fill up secrets for the pipeline. |
Beta Was this translation helpful? Give feedback.
-
I don't mind having the image being published, but what use case do you see for gdg running in a helm chart or kubernetes? It's a pretty standard alone app. As far as publishing docker containers. I think it would be better to use https://goreleaser.com/customization/docker/ since it's the tool responsible for building all the release artifacts, it makes more sense to have it do the work than having another workflow. Need to figure out where to drop it. Technically esnet has a public registry to be used for OSS project but needs some work to get it in a usable state. Alternatively github can act as a docker registry as well. |
Beta Was this translation helpful? Give feedback.
-
@safaci2000 I just suggest the first solution comlex solution. You can choose whatever you think will be better, I just need GDG in docker image with public registry. BTW, I guess people who recreate a lot of VMs will prefer to use GDG in docker, better than installing Go, dependencies and etc |
Beta Was this translation helpful? Give feedback.
-
Well, you don't need to install Go to run GDG, that's part of the appeal of go, is the output is a statically compiled binary. You can find them in the release page. That being said, having a public docker container should be easy enough. Just need to get some time to figure out where to push, thanks for the PR though. I appreciate the effort. |
Beta Was this translation helpful? Give feedback.
-
@yevhen-kalyna I added a CICD pattern to publish a docker container. Can you confirm that you can pull the following images: ghcr.io/esnet/gdg:latest More details can be found on here: https://github.com/esnet/gdg/pkgs/container/gdg |
Beta Was this translation helpful? Give feedback.
-
Same for all images. Also, the link shows 404 error. I guess you created a private registry. |
Beta Was this translation helpful? Give feedback.
-
BTW, gdg in docker container can't create any folders and files, lack of permissions for user.
|
Beta Was this translation helpful? Give feedback.
-
I need an override from the powers the org level to make the package public. Working on that, for now, pull this: safaci2000/testing:gdg_0_3_1 It should be the same image. The image is running as root so there really shouldn't be an issue with creating folders. There are two volumes defined: you should be able to override both and set them to anything local volume of K8s storage. |
Beta Was this translation helpful? Give feedback.
-
This should all be resolved. Let me know when you have a chance. Should be able to pull from the repo directly. |
Beta Was this translation helpful? Give feedback.
-
@safaci2000, Sorry for the late response. Just checked, and got the same error.
Registry not public. For testing purposes, you can |
Beta Was this translation helpful? Give feedback.
-
I had some issue with the versioning where the v was included or excluded in some cases. Try pulling: docker pull ghcr.io/esnet/gdg:0.3.1 or docker pull ghcr.io/esnet/gdg:0.3 both of which should give you the same docker binary. Let me know if you still have issues. I confirmed the image is public from a GCP VM so you should be good to go. |
Beta Was this translation helpful? Give feedback.
-
You're right, it's my local issue with pulling from GitHub. Will fix it and come to you with feedback about image. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I pulled the image end tested it with k8s. But see a few issues with docker image and gdg:
|
Beta Was this translation helpful? Give feedback.
-
#find /app/ it has a really basic default config embedded into the binary but if you simply have a volume mount that has a YML file loaded in /app/conf/importer.yml for example it should work fine. At this point this is more of a discussion, I'm going to convert this to a conversation thread as I believe this is working as expected from my perspective. |
Beta Was this translation helpful? Give feedback.
-
@yevhen-kalyna Try pulling the same tags again. I was missing the WORKDIR directive so everything was running off the root of the image. It should work now. Or add a |
Beta Was this translation helpful? Give feedback.
-
Working for me, |
Beta Was this translation helpful? Give feedback.
-
Awesome. Enjoy and let me know if you run into any more trouble. I added some minor documentation on here as well: https://software.es.net/gdg/docs/installation/#docker-usage |
Beta Was this translation helpful? Give feedback.
@yevhen-kalyna Try pulling the same tags again. I was missing the WORKDIR directive so everything was running off the root of the image. It should work now. Or add a
working_dir: /app
directive to your docker-compose manifest or equivalent for K8.