Giter Club home page Giter Club logo

Comments (11)

abiosoft avatar abiosoft commented on May 14, 2024 9

What is the expected behaviour? Does this work out of the box with docker for mac?

I was able to get it to run successfully by having multiple nodes as per the instruction on https://docs.docker.com/buildx/working-with-buildx/.

Steps

Note:
The following commands are not available until the next release of Colima, which supports multiple instances and docker contexts. For now you can build from source or brew install --head colima

1. Create instances for the two architectures.

The instance with non-native architecture will run noticeably slower. This is expected as the processor is being emulated by qemu.

Create an instance for amd64/x86_64 architecture

colima start --profile amd --arch amd

Create an instance for arm64/aarch64 architecture

colima start --profile arm --arch arm

2. Create a buildx context to use the created instances as nodes.

Step 1 (if successful) should create colima-amd and colima-arm docker contexts. Specify them in the new buildx context.

docker buildx create --use --name custom colima-amd
docker buildx create --append --name custom colima-arm

3. Run docker buildx build

Everything should be fine now and running docker buildx build should work as desired.

from colima.

abiosoft avatar abiosoft commented on May 14, 2024 5

Though this is still a valid approach #44 (comment), multiple instances are no longer required. You can reverse those steps.

Kindly update to the latest development version brew install --head colima and start colima (or restart if running). Multi-architecture support should now be there out of the box.

Running images of different architectures should work fine. e.g.

docker run --rm --platform linux/amd64 alpine
docker run --rm --platform linux/aarch64 alpine 

Using docker buildx build requires at most one step.

# this is assuming default profile, 
# otherwise the name would be `colima-<profile>` e.g. `colima-arm`.
docker buildx create --use colima

from colima.

gayanhewa avatar gayanhewa commented on May 14, 2024 2

Any idea what would cause this on the m1?

Screen Shot 2022-02-07 at 2 19 17 pm

from colima.

dustinrue avatar dustinrue commented on May 14, 2024 1

Thanks for taking a look! I gave this a try and it seems to be working well.

FWIW it does in fact work with 0 modifications when using Docker Desktop. Using this as a solution is perfectly fine though.

from colima.

abiosoft avatar abiosoft commented on May 14, 2024 1

If that is the case, Docker Desktop handles it internally for better user experience.

I will revisit this later.

from colima.

abiosoft avatar abiosoft commented on May 14, 2024 1

I have found a proper solution to this that would require almost no setup from the user :)
Will push a fix soon.

from colima.

dustinrue avatar dustinrue commented on May 14, 2024 1

Excellent! I look forward to testing it. FWIW I am having good luck with Colima on my Intel Mac mini and my M1 powered MBA.

from colima.

abiosoft avatar abiosoft commented on May 14, 2024 1

@gayanhewa @goshlanguage this should no longer happen as cross-architecture is supported (though limited).

More complex images like java jvm or mssql-server may not behave correctly but most of the amd64 images will work fine on M1.

Nonetheless, it is better and recommended to use the arm64 images instead.

from colima.

abiosoft avatar abiosoft commented on May 14, 2024

I will be closing as this is not really a Colima issue.

from colima.

dustinrue avatar dustinrue commented on May 14, 2024

Confirmed, this is working perfectly for me and I am able to build and run multi-arch images just like before! Nice work!

from colima.

goshlanguage avatar goshlanguage commented on May 14, 2024

Any idea what would cause this on the m1?

Screen Shot 2022-02-07 at 2 19 17 pm

@gayanhewa m1s use arm64 architecture, not amd64 as shown in your screenshot. Your CPU doesn't know how to talk amd64 so when you try to run that specifically, it can't, resulting in exec format error

from colima.

Related Issues (20)

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.