{"id":13786746,"url":"https://github.com/x1unix/docker-go-mingw","last_synced_at":"2026-04-02T14:06:03.601Z","repository":{"id":45610736,"uuid":"296050180","full_name":"x1unix/docker-go-mingw","owner":"x1unix","description":"Docker image for building Go binaries with MinGW toolchain. Supports Windows on ARM!","archived":false,"fork":false,"pushed_at":"2026-03-26T20:41:39.000Z","size":145,"stargazers_count":53,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-03-27T08:46:48.572Z","etag":null,"topics":["docker-golang","docker-mingw","go","golang","golang-windows","mingw","mingw-w64","windows-on-arm","woa"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/x1unix/go-mingw","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x1unix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["x1unix"],"liberapay":"x1unix"}},"created_at":"2020-09-16T14:02:35.000Z","updated_at":"2026-03-26T20:39:14.000Z","dependencies_parsed_at":"2026-03-04T18:04:34.802Z","dependency_job_id":null,"html_url":"https://github.com/x1unix/docker-go-mingw","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/x1unix/docker-go-mingw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x1unix%2Fdocker-go-mingw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x1unix%2Fdocker-go-mingw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x1unix%2Fdocker-go-mingw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x1unix%2Fdocker-go-mingw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x1unix","download_url":"https://codeload.github.com/x1unix/docker-go-mingw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x1unix%2Fdocker-go-mingw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31307495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-golang","docker-mingw","go","golang","golang-windows","mingw","mingw-w64","windows-on-arm","woa"],"created_at":"2024-08-03T19:01:32.944Z","updated_at":"2026-04-02T14:06:03.589Z","avatar_url":"https://github.com/x1unix.png","language":"Shell","funding_links":["https://github.com/sponsors/x1unix","https://liberapay.com/x1unix"],"categories":["Software Packages","DevOps Tools","软件包","Go Tools"],"sub_categories":["DevOps Tools","DevOps 工具"],"readme":"# go-mingw\n\n[![Docker Hub](https://img.shields.io/docker/pulls/x1unix/go-mingw.svg)](https://hub.docker.com/r/x1unix/go-mingw)\n[![Docker Hub](https://img.shields.io/docker/v/x1unix/go-mingw.svg?sort=semver)](https://hub.docker.com/r/x1unix/go-mingw)\n\nDocker image for building Go binaries for **Windows** with MinGW-w64 toolchain based on official Go Docker image.\n\nImage provides simple cross-compilation environment for windows 32 and 64bit builds.\n\n**Supports Windows on Arm!**\n\n## Supported Architectures\n\nHere is a list of supported host and target architectures:\n\n| Host Architecture   | Win x86 | Win x86-64 | Win Arm64 |\n| ------------------- | ------- | ---------- | --------- |\n| **arm64 / aarch64** | ✅      |  ✅        | ✅        |\n| **amd64**           | ✅      |  ✅        | ✅        |\n\n## Usage\n\nYou can pull Docker image with desired Go version:\n\n```shell\ndocker pull x1unix/go-mingw:latest # or \"1.24\" for specific Go version\n\n# Or if you prefer to use GHCR:\ndocker pull ghcr.io/x1unix/docker-go-mingw/go-mingw:1.24\n```\n\n\u003e [!TIP]\n\u003e Please take a look at [examples](example/) before starting to work.\n\n### Using on CI/CD\n\nExamples for GitLab CI and GitHub Actions are available [here](https://github.com/x1unix/docker-go-mingw/blob/master/example/ci)\n\n### Building Go applications inside container\n\nMount directory with app source and build it:\n\n```shell\ndocker run --rm -it -v /YourPackageSrc:/go/work \\\n    -w /go/work \\\n    x1unix/go-mingw go build .\n```\n\nYou will get compiled Windows binary.\n\n#### Windows On Arm\n\nSet `GOARCH=arm64` to build ARM Windows binary:\n\n```shell\ndocker run --rm -it -e GOARCH=arm64 -v /YourPackageSrc:/go/work \\\n    -w /go/work \\\n    x1unix/go-mingw go build .\n```\n\n#### For 32-bit toolchain\n\nTo build a 32-bit executable, set `GOARCH=386` variable:\n\n```shell\ndocker run --rm -it -e GOARCH=386 -v /YourPackageSrc:/go/work \\\n    -w /go/work \\\n    x1unix/go-mingw go build .\n```\n\n\u003e [!TIP]\n\u003e See check project build examples [here](example).\n\n### Go linker flags override\n\nGo linker and compiler flags can be specified using container environment variables via `-e` option.\n\n**Example:**\n\n```shell\ndocker exec -it\n    -e LDFLAGS=\"-linkmode external -extldflags '-static -s -w'\"\n    ...\n```\n\n### Output files ownership\n\nBy default, Go container starts as a *root* user. It means, that all produced files\nwill be owned by `root:root` user.\n\nTo set files to be owned by your current user by default, start the container with your current **uid/gid**.\n\nUse `-u` flag to start container with different user/group id.\n\n```shell\n# Start container as other uid/gid\ndocker exec --rm -it -u \"$UID:$GID\" ...\n```\n\n\u003e [!IMPORTANT]\n\u003e For non-root container user, it is recommended to mount your host GOPATH and GOCACHE.\n\n### Go Build Cache\n\nIn order to speed up build times and keep Go build cache, it is recommended to mount local Go build cache directory or create a separate Docker volume for it.\n\n**Mounting local GOPATH:**\n\n```shell\ndocker run --rm -it \\\n    -u $UID \\\n    -v /YourPackageSrc:/go/work \\\n    -v $(go env GOCACHE):/go/cache \\\n    -e GOCACHE=/go/cache \\\n    -w /go/work \\\n    x1unix/go-mingw go build .\n```\n\n**Using Docker volume:**\n\n```shell\n# Create Docker volume\ndocker volume create go-cache\n\n# Run container with attached volume\ndocker run --rm -it \\\n    -v /YourPackageSrc:/go/work \\\n    -v go-cache:/go/cache \\\n    -e GOCACHE=/go/cache \\\n    -w /go/work \\\n    x1unix/go-mingw go build .\n```\n\n\u003e [!TIP]\n\u003e See [Docker volumes docs](https://docs.docker.com/storage/volumes/) for more info.\n\n### Go modules cache\n\nIn addition to Go build cache, you may also want to mount Go modules cache \nto avoid modules re-download on each build.\n\nTo do this, mount your GOPATH or Go modules directory (`$GOPATH/pkg`).\n\n### Building custom Docker image\n\nDocker image can be rebuilt locally with a desired Go version:\n\n```shell\nmake image GO_VERSION=1.24\n```\n\n\u003e [!IMPORTANT]\n\u003e Replace `1.24` with desired Go version.\n\n## Credits\n\n* [llvm-mingw](https://github.com/mstorsjo/llvm-mingw) for Windows on Arm support.\n* [mingw-w64](https://www.mingw-w64.org/) - for Windows on x86 and amd64 support.\n* The Go maintainers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx1unix%2Fdocker-go-mingw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx1unix%2Fdocker-go-mingw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx1unix%2Fdocker-go-mingw/lists"}