Clone, build, and execute Go code in a lightweight Alpine container
1.0K
This Docker image is designed to download, compile, and run a Go program from a Git repository entirely at container runtime. It supports both public and private repositories and works seamlessly across multiple architectures.
Built on Alpine Linux for a minimal, efficient footprint.
.netrc-based authGIT_REFlinux/amd64, linux/arm64, linux/arm/v7docker run --rm \
-e GIT_REPO=https://git.tordarus.net/tordarus/hello-world.git \
-e GIT_REF=main \
tordarus/gorunner:latest
Create a docker-compose.yml:
services:
gorunner:
image: tordarus/gorunner:latest
environment:
GIT_REPO: https://git.tordarus.net/tordarus/hello-world.git
GIT_REF: main # Optional – specify branch, tag, or commit
GIT_USERNAME: yourusername # Optional for public repos
GIT_TOKEN: yourtoken # Optional for public repos
APP_PATH: . # Optional – subdir of Go app
PACKAGES: curl # Optional – comma-separated apk packages
Then run it with:
docker compose up
| Variable | Required | Description |
|---|---|---|
GIT_REPO | Yes | The HTTPS Git URL of your Go project |
GIT_REF | Optional | Branch name, tag, or commit hash to checkout after clone (default: HEAD) |
GIT_USERNAME | Optional | Your Git username (required for private repos) |
GIT_TOKEN | Optional | A personal access token or password (required for private repos) |
APP_PATH | Optional | Relative path to the Go module directory inside the repo (default: .) |
PACKAGES | Optional | Comma-separated list of packages to install with apk before execution |
Pull the image from Docker Hub: tordarus/gorunner
View the source code: https://git.tordarus.net/tordarus/gorunner
Found a bug or have an idea for improvement? Create an issue in the repository.
MIT License – feel free to modify and use.
Content type
Image
Digest
sha256:158d07528…
Size
78.6 MB
Last updated
13 days ago
docker pull tordarus/gorunner