Coder Social home page Coder Social logo

zk-xcompile's Introduction

Cross-compiling zk with Docker

Largely inspired by dh1tw and remoteAudio-xcompile.

How to invoke?

You can compile the zk source code directly from the source code directory. As example, for compiling the binary for linux/arm64 you have to execute the following command:

docker run --rm -v "$PWD":/usr/src/zk -w /usr/src/zk ghcr.io/zk-org/zk-xcompile:linux-arm64 /bin/bash -c 'make'

This call is already set in zk Makefile, e.g. make dist-linux-amd64.

More detail is documented here on Golang's docker hub.

The images are hosted with ghcr within zk-org.

Releasing changes

Clone this repo, make necessary changes, submit a PR. After PR is confirmed, proceed with building and pushing.

Building

docker buildx build -t ghcr.io/zk-org/zk-xcompile:linux-amd64 ./linux-amd64
docker push ghcr.io/zk-org/zk-xcompile:linux-amd64

or via the build script

./build # builds all images
./build ./linux-amd64 ./linux-arm64 # build desired images only

Pushing

Logout of docker if you're currently logged in: docker logout or via Docker Desktop.

Then login to ghcr.io with your personal access token. Only members of zk-org can push. Docs are here.

For example:

echo $ZK-TOKEN | docker login ghcr.io -u USERNAME --password-stdin

Then you can push to our container registry.

docker push ghcr.io/zk-org/zk-xcompile:linux-amd64

or via the push script

./push # pushes all images to zk-org ghcr
./push ./linux-amd64 ./alpine-amd64 # push desired images only

zk-xcompile's People

Contributors

mickael-menu avatar tjex avatar

Watchers

 avatar  avatar  avatar  avatar

zk-xcompile's Issues

arm64 image tagged as amd64

When trying to build for amd64 I get the error below because the image is actually arm64/V8. I was able to build the amd64 image locally.

$ docker run --platform linux/amd64 --rm -v "${PWD}":/usr/src/zk -w /usr/src/zk mickaelmenu/zk-xcompile:linux-amd64 /bin/bash -c 'make'
Unable to find image 'mickaelmenu/zk-xcompile:linux-amd64' locally
linux-amd64: Pulling from mickaelmenu/zk-xcompile
Digest: sha256:5888bd7ecc5961f4a636c2697f4313ca9f4df3442baa1b0c99b35ede5402853c
Status: Image is up to date for mickaelmenu/zk-xcompile:linux-amd64
docker: Error response from daemon: image with reference mickaelmenu/zk-xcompile:linux-amd64 was found but does not match the specified platform: wanted linux/amd64, actual: linux/arm64/v8.
See 'docker run --help'.

images need go 1.21

When building for linux-amd64 I'm getting the error:

# github.com/zk-org/zk/internal/adapter/editor
note: module requires Go 1.21
go build github.com/zk-org/zk/internal/adapter/editor: /usr/local/go/pkg/tool/linux_amd64/compile: signal: segmentation fault
# github.com/mattn/go-sqlite3
gcc: internal compiler error: Segmentation fault signal terminated program cc1

I'm assuming this is (solely) due to upgrading the version dependancy in go.mod for zk source.

So @zk-org/maintainers
How should we handle this fix considering we're an org now and want to bother you as little as possible, Mickael?

Docker org requires a paid team plan. So one of us new maintainers should take over the images on docker hub?

Or we could make a dummy email for a 'zk-org' user and share a password?

Thoughts?

I would vote for a dummy email and shared password as it avoids this thorn if / when a maintainer also needs some time out temporarily or permanently.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.