Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): Add support for multi-platform build #563

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MrCyjaneK
Copy link
Contributor

This pull request close #559

Since docker already support multiarch by using qemu, it would be cool to have abstruse support it also,

Commands required to setup:

(HOST)# apt install -y qemu binfmt-support qemu-user-static
(HOST)# docker run --rm --privileged multiarch/qemu-user-static:register

Currently there is no gui for setting platforms (and it is not likely that I'll do that.. I have no idea how frontend works), so in database you need to update platforms row with something like: linux/amd64;linux/arm64

After that trigger a build and you will see this:

linux/arm64 linux/amd64
image image

@@ -35,6 +35,7 @@ type (
Provider Provider `json:"-"`
EnvVariables []EnvVariable `json:"-"`
Mounts []*Mount `json:"mounts"`
Platforms string `json:"platforms"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an array?

Suggested change
Platforms string `json:"platforms"`
Platforms []string `json:"platforms"`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah! That will make things easier

job, err = s.jobs.Find(job.ID)
if err != nil {
return nil, err
for platform := range strings.Split(repo.Platforms, ";") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for platform := range strings.Split(repo.Platforms, ";") {
for _,platform := range repo.Platforms {

@MrCyjaneK
Copy link
Contributor Author

@belsakn panic: invalid sql type (slice) for sqlite3 I got this error when I tried to use []string

@belsakn
Copy link
Contributor

belsakn commented Sep 14, 2021

@MrCyjaneK will check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(): Multiarch support
2 participants