This project provides a Docker-based build environment for Go projects, including tools for database migrations and testing.
Dockerfile
: Defines the Docker image used for building and testing the Go project.README.md
: Documentation for the project.
The Dockerfile
sets up a multi-stage build environment:
-
Builder Stage:
- Based on
ubuntu:bionic
. - Installs necessary packages including
wget
andgnupg-agent
. - Downloads and installs the
migrate
tool for database migrations. - Downloads and installs the
wait-for
script for synchronizing service dependencies.
- Based on
-
Final Stage:
- Based on
golang:1.22-alpine
. - Sets environment variables for
godog
andgoimports
versions. - Installs additional packages including
git
,make
, andbash
. - Installs Go tools:
gocover-cobertura
,godog
, andgoimports
. - Copies the
migrate
andwait-for
binaries from the builder stage.
- Based on
To build the Docker image, run:
docker buildx build --push --platform linux/amd64 -t gitsid/grpc-go-base-builder:1.22 -t gitsid/grpc-go-base-builder:latest .