Crazy-max/xgo: Go CGO Cross Compiler - GitHub

GitHub release Total downloads Build Status Test Status Docker Stars Docker Pulls Go Report Card

Become a sponsor Donate Paypal

  • Fork
  • Build
  • Documentation
  • Contributing
  • Lisence

Fork

This repository is a fork of karalabe/xgo to push images and tags to a single docker repository on several registries to make things more consistent for users. It uses goxx image as base that provides all the necessary Go tool-chains, C/C++ cross-compilers and platform headers/libraries.

Registry Image
Docker Hub crazymax/xgo
GitHub Container Registry ghcr.io/crazy-max/xgo
$ docker buildx imagetools inspect crazymax/xgo --format "{{json .Manifest}}" | \ jq -r '.manifests[] | select(.platform.os != null and .platform.os != "unknown") | .platform | "\(.os)/\(.architecture)\(if .variant then "/" + .variant else "" end)"' linux/amd64 linux/arm64

This also creates a standalone xgo executable that can be used on many platforms.

Build

Build xgo yourself using Docker buildx bake:

git clone https://github.com/crazy-max/xgo.git xgo cd xgo # Build xgo image and output to docker with xgo:local tag docker buildx bake # Tests BASE_IMAGE=xgo:local docker buildx bake test-c BASE_IMAGE=xgo:local docker buildx bake test-cpp BASE_IMAGE=xgo:local docker buildx bake test-gorm # Create xgo artifacts in ./dist docker buildx bake artifact-all

Documentation

  • About
  • Enter xgo
  • Installation
  • Usage
    • Build flags
    • Go releases
    • Output prefixing
    • Branch selection
    • Remote selection
    • Package selection
    • Limit build targets
    • Platform versions
    • CGO dependencies

Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by becoming a sponsor on GitHub or by making a PayPal donation to ensure this journey continues indefinitely!

Thanks again for your support, it is much appreciated! 🙏

License

MIT. See LICENSE for more details.

Từ khóa » Xgo