-
Notifications
You must be signed in to change notification settings - Fork 121
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
Inhouse docker image builds #323
Conversation
Oops, let me rebase this from dev -> main. |
This way it doesn't matter how configs are named.
This brings over only only drop dead simple bits that really should live with the tool itself. Major benefits: - Can easily build any state of the repo regardless of branch or mid-development into a functional image without mucking about with an external repo. - Faster builds when the source code is already present without an extra clone Minor fixes added as well: - entrypoint.sh was missing a shebang - Simplified entrypoint running now that the script has a proper shabang - Simplified logic by switching WORKDIR earlier - Add a .dockerignore file to prune dirty state and useless weight from the container. Does not include: - Any documentation. Docker is an advanced option in any case but this should be added as a followup. - Automated Docker builds. Those come in the next commit.
- Images based on the `main` branch will update the `latest` tag. - Other branches will be tagged with the branch name and first 6 chars of commit hash. - Any git tags will tag images as-is, say `v0.7.0` would become: `ghcr.io/martomi/chiadog:v0.7.0`
e77f908
to
26c7b8b
Compare
Example image has been automatically built in my fork: https://github.com/Artanicus/chiadog/pkgs/container/chiadog .. this shows the logic for non-special branches with the image name becoming: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @Artanicus !
I agree with the benefits you listed and particularly like the automated build workflow 👍
Please check some feedback I have below.
This reverts commit 5f2b542.
- Breaking change for anyone coming from ajacobson/chiadog-docker: The config dir env variable is now called CHIADOG_CONFIG_DIR - Switch base image to python:3.10-slim, reduced image size significantly - Dropped manual TZ handling at the container system level, just setting env TZ is enough - Dropped manual PyNaCL install, requirements pull in the binary wheel just fine - Simplify entrypoint and use sh for security.
@martomi PTAL, all feedback incorporated and everything simplified quite a bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great now, thanks!
Automated docker image builds (martomi#323)
* Inhouse Dockerfile and entrypoint from ajacobson/chiadog-docker This brings over only only drop dead simple bits that really should live with the tool itself. Major benefits: - Can easily build any state of the repo regardless of branch or mid-development into a functional image without mucking about with an external repo. - Faster builds when the source code is already present without an extra clone Minor fixes added as well: - entrypoint.sh was missing a shebang - Simplified entrypoint running now that the script has a proper shabang - Simplified logic by switching WORKDIR earlier - Add a .dockerignore file to prune dirty state and useless weight from the container. Does not include: - Any documentation. Docker is an advanced option in any case but this should be added as a followup. - Automated Docker builds. Those come in the next commit. * Automate building of Docker images. - Images based on the `main` branch will update the `latest` tag. - Other branches will be tagged with the branch name and first 6 chars of commit hash. - Any git tags will tag images as-is, say `v0.7.0` would become: `ghcr.io/martomi/chiadog:v0.7.0` * Simplify & improve Docker image, change config env to CHIADOG_CONFIG_DIR - Breaking change for anyone coming from ajacobson/chiadog-docker: The config dir env variable is now called CHIADOG_CONFIG_DIR - Switch base image to python:3.10-slim, reduced image size significantly - Dropped manual TZ handling at the container system level, just setting env TZ is enough - Dropped manual PyNaCL install, requirements pull in the binary wheel just fine - Simplify entrypoint and use sh for security.
This hugely builds on the work by @ajacobson (https://github.com/ajacobson/chiadog-docker) and no disrespect is intended.
Proposing merge to
main
instead ofdev
since this does not in any way modify how Chiadog works and will then enable images to be built for any and all branches regardless of when dev is merged to main.Major benefits of inhousing:
mid-development into a functional image without mucking about with an
external repo. Doing other chiadog development made me frustrated enough to also fix this. :-)
Minor fixes added as well:
the container.
Does not include:
should be added as a followup.