ATAC
ATAC copied to clipboard
feat: continuous deployment for docker image
Closes #96
Usage
The workflow is currently configured to be build-only mode. To enable pushing the image to Docker Hub, you'll need to:
- Set the
DOCKERHUB_USERNAMEandDOCKERHUB_TOKENvariables in the repository secrets. - Set the
PUSH_IMAGEvariable totrue(or remove it entirely) in.github/workflows/build-docker.yml.
Once configured, the workflow will automatically push the image to Docker Hub when:
- The
mainbranch is updated, or - A release is published.
Changes
- Added a Dockerfile that builds the app using cargo-chef to optimize Docker build caching. On a clean build (e.g., the first time this workflow runs or when dependencies are updated), it takes around 15-20 minutes to complete. If dependencies are cached, the build time reduces to ~5 minutes.
- Integrated cargo-zigbuild to build a multi-platform image supporting both
linux/amd64andlinux/arm64. It should be straightforward to add other targets to the build process.
Limitations
- The final build command
cargo zigbuild --release ...seems to execute every time, and I'm not sure why this happens. - The
cargo-chefDocker image currently supports onlylinux/amd64andlinux/arm64. To support other platforms, the Dockerfile needs to be adjusted, by using a different base image and addingcargo install cargo-chef.
Let me know if the docker usage should be included in README, I'll try to add it! :smiley: