-
Notifications
You must be signed in to change notification settings - Fork 6
chore: add docker-build #40
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
base: release
Are you sure you want to change the base?
Conversation
This adds a Dockerfile and Makefile rule to build the code in Docker (on non-Ubuntu hosts). The built binary will be placed in dist/tigrisfs. This also removes `.git` from `.dockerignore` because `git describe` is needed in the build process inside the container to determine the version label.
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.
Greptile Overview
Summary
This PR adds Docker containerization support to enable building TigrisFS on non-Ubuntu hosts. The implementation uses a multi-stage build approach with Ubuntu as the build environment and produces a minimal scratch-based final image containing only the binary.
Key changes:
- Added
Dockerfilewith multi-stage build using Ubuntu base image and scratch final stage - Added
docker-buildMake target that outputs todist/directory using Docker BuildKit - Removed
.gitfrom.dockerignoreto enable version detection viagit describe - Minor Go version format update in
go.mod(1.24 → 1.24.0)
The Docker setup correctly installs all necessary build dependencies and follows container best practices with CGO disabled and minimal final image size.
Confidence Score: 4/5
- This PR is safe to merge with minimal risk
- Score reflects a well-implemented Docker build solution with only minor improvements suggested (pinning base image version)
- Consider pinning the Ubuntu base image version in Dockerfile for reproducible builds
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| .dockerignore | 5/5 | Removed .git from dockerignore to allow git describe for version labeling - necessary change |
| Dockerfile | 4/5 | Multi-stage Docker build using Ubuntu base with necessary build tools, produces minimal scratch-based final image |
| Makefile | 5/5 | Added docker-build target that outputs to dist directory, simple and straightforward implementation |
| go.mod | 5/5 | Minor version format change from 1.24 to 1.24.0, cosmetic change with no functional impact |
4 files reviewed, 1 comment
|
Could you add a CI workflow that tests the docker build? |
I am not exactly sure, it's useful for CI because you already have CI set up, right? It's more for people like me who want to build locally but don't have the required system on their host. Anyway, I added a draft Github Actions definition but I could not try it because I don't have Github Actions enabled on my forked repo. And I am not sure, ubuntu:latest has docker support installed by default. |
pin checkout action to v5 Co-authored-by: Scott Brenner <[email protected]>
This adds a Dockerfile and Makefile rule to build the code in Docker (on non-Ubuntu hosts). The built binary will be placed in dist/tigrisfs.
This also removes
.gitfrom.dockerignorebecausegit describeis needed in the build process inside the container to determine the version label.Note
Add Dockerfile and Makefile target to build binary in Docker and a CI workflow to run it, plus minor .dockerignore and Go version tweaks.
ubuntu:latest; runsmake setupandmake build; outputs static binary toscratchimage.docker-buildtarget (and.PHONY) to producedist/viadocker build --output dist ...github/workflows/docker-build.yamlbuilds onpushtomainand verifiesdist/tigrisfs..dockerignore: remove.gitto allow versioning metadata; keepgoofys.go.mod: bumpgoto1.24.0.Written by Cursor Bugbot for commit ce42618. This will update automatically on new commits. Configure here.