Skip to content

Conversation

@tvogel
Copy link

@tvogel tvogel commented Sep 27, 2025

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.


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.

  • Build/CI:
    • Dockerfile: Multi-stage build on ubuntu:latest; runs make setup and make build; outputs static binary to scratch image.
    • Makefile: Add docker-build target (and .PHONY) to produce dist/ via docker build --output dist ..
    • GitHub Actions: New workflow at .github/workflows/docker-build.yaml builds on push to main and verifies dist/tigrisfs.
  • Housekeeping:
    • .dockerignore: remove .git to allow versioning metadata; keep goofys.
    • go.mod: bump go to 1.24.0.

Written by Cursor Bugbot for commit ce42618. This will update automatically on new commits. Configure here.

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

@greptile-apps greptile-apps bot left a 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 Dockerfile with multi-stage build using Ubuntu base image and scratch final stage
  • Added docker-build Make target that outputs to dist/ directory using Docker BuildKit
  • Removed .git from .dockerignore to enable version detection via git 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

Edit Code Review Agent Settings | Greptile

@ovaistariq
Copy link
Contributor

Could you add a CI workflow that tests the docker build?

@tvogel
Copy link
Author

tvogel commented Sep 30, 2025

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]>
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

Successfully merging this pull request may close these issues.

3 participants