I decided to setup a Linux VM on Mac and install my Docker dev environment on the Linux VM. Things to have in mind when selecting your host: Have an exclusive machine to host the server to make sure resources will be promptly available to the serverSo I’ve been using my new M1-based MacBook Pro for a couple of months for a mix of development, email, and other things an open-source maintainer does day-to-day.Inspired by Windows WSL which runs a Linux VM that is integrated with Windows. Therefore you may pick the platform you like the best and feel comfortable with. As mentioned, Docker runs on Windows, Mac OS X and several Linux distributions.Subsequently, we will be discussing the following topics in this article:The typical first reaction that you get when using this is “it runs my Docker stack without sounding like a plane taking off?”.Docker is a Linux container management toolkit with a social aspect. Deb ' packages for Linux architectures and distributions for various Linux versions. In addition, Docker provides '.This is why I think ARM is the future, even if it might take a decade for the mainstream cloud to migrate over.My Xeon Linux-based workstation suddenly feels old. It also means longer battery cycles for non-cloud use-cases (less waste, more bang for the buck). A number of fast-growing tech giants (besides Apple) are pouring a ton of money into making ARM work for a ton of use-cases: Nvidia (trying to buy ARM Holdings from SoftBank) and Amazon (deep investment in the new Graviton processors) are the two that primarily come to mind.As you might know, in processors low energy consumption (and low heat dissipation) often equates to the ability to scale processing efficiently for large workloads.However, you can also install it manually via /usr/sbin/softwareupdate -install-rosettaThe tools you use for development are likely still catching up to this architectural change, and will be for some time. The OS will automatically detect that Rosetta is needed and prompt you to install it. To emulate an application, you just need to install Rosetta 2. I found that if an ARM-native version is not available for an application, the emulated one works just fine and there’s no performance drawback that I can notice.
Windows , , Or Linux For Docker Install My DockerThe amd64 version works perfectly well, however, the terminal will be an amd64 process, which may cause some programs to also run as amd64. Here are some programs that I’ve tested: In some cases, I had to install preview editions of software, but everything worked very well for me. ![]() ![]() ✅ C++ works fine on native architecture in Docker. It seems that there are no official OpenJDK builds for aarch64, however there are some community options. I had issues with the JVM, experiencing random process hangs. I built binaries in Docker and ran them natively. ✅ gRPC works fine on native architecture in Docker. ✅ Elixir works fine on native architecture in Docker. Did not immediately work natively (and I did not investigate). Minimal testing though.How to Tell What Architecture a Program Is Running AsIt’s extremely easy to mistake the kind of architecture you run as. ✅ Rust works fine on native architecture in Docker. ✅ Cobol (yes, really) works fine on native architecture in Docker. ✅ Ruby and Ruby on Rails works fine on native architecture in Docker. ✅ Python works fine on native architecture in Docker. It’ll say either X86_64, arm64 (Mac) or aarch64 (Linux). Activity Monitor showing Zoom as an Apple process Activity Monitor showing Spotify as an Intel processIf you’re not sure about the terminal you’re using, you can type uname -m. Here’s how I can tell that Zoom is an ARM process, while Spotify is an X86_64 process. If it says Intel, it’s X86_64. Using brew doctor I was able to find out that Xcode needed a (re)install. This is pure speculation, however, I’ve not researched this.(In any case, a very impressive effort to switch architecture so quickly for a project that hosts so many packages!)Back to fixing the issue now. Not sure what the cause of this is, but it could be the fact that brew has been adding native arm support for many packages in the last few months and it’s possible that this migration resulted in some inconsistencies. Terminal showing the output of uname -m as arm64 Brew IssuesOne issue I encountered on both my M1 laptop and also a MacStadium MacMini instance that we use for Mac testing is that Brew randomly started to complain about git missing. (If anyone reading this knows what’s up with my brew’s git and can tell me how to fix it, ping me on Twitter: Using DockerThe Docker preview worked almost flawlessly for me from day 1. Instead, I was able to just remove the brew git via brew uninstall git and simply rely on git from Xcode, which seems to work just fine. I was not as comfortable doing that on my laptop after having installed so much via casks. On the MacStadium instance, I was able to just uninstall brew and reinstall it and everything was fine. However, the issue was still there. R18 drama cdFor more details on building multi-platform images see Akihiro Suda’s blog.If you docker pull an image from the registry, it will again default to your native architecture (if available), unless you specify -platform=linux/amd64.If you docker run an image, it will default to whatever version of the image you have available locally or it will attempt to pull the arm64 version from the registry. Instead of the usual docker build. I also noticed that some alpine packages are also not available for ARM (for example shellcheck).To build an image for a different architecture, you can use docker buildx build -platform=linux/amd64. Your mileage may vary, however, if you are curling some binary that may need to switch from X86_64 to aarch64 in its URL, or if you’re doing lower-level stuff. If you’re building an image, by default it’ll use your native architecture to execute the build (arm64) and most things will magically just work. Most official images are now supported on arm64 too. Or at least that’s what claims](). However, if you run your natively-supported Docker-in-Docker, the inner Docker can still run multi-platform images fine.There are currently performance issues with multi-processor use - so much so that performance using a single core is sometimes slightly better than the performance of using 8 cores. So you cannot run an arm64 Docker in an amd64 Docker or vice-versa. You can also specify platform: linux/amd64 for the service definition in docker-compose.yml if you’d like to be specific.One thing to note is that Docker-in-Docker is not supported by QEMU ( abandoned PR on GitHub). The same rules apply with regards to pulling and running. Terminal showing the output of uname -m for different container platformsDocker Compose will happily run a mixture of various architectures. ![]() This is relatively rare, however - most Docker builds just work across either platform.
0 Comments
Leave a Reply. |
Details
AuthorEmily ArchivesCategories |