Docker has just rececently rolled out support for multiple-architecture images. For instance, python:3.6 is an example, as is debian:8.
https://blog.docker.com/2017/09/docker-official-images-now-multi-platform/
https://developer.ibm.com/linuxonpower/2017/07/27/create-multi-architecture-docker-image/
I would be both convenient and useful for people if home-assistant Docker image was multi-architecture in the same way python (for example), particularly as it is an extremely convenient way to get home-assistant up and running on a Raspberry Pi, for instance.
Of course this is not necessarily trivial to write the build scripts for, and it's beyond my personal Docker knowledge how to do this and contribute a PR, but I would request you keep this ticket open as a feature request. It appears possible to build Arm (and other other architecture images) using architecture emulator QEMU on amd64.
In the meantime, I've cloned the repo and built my own docker image on my Raspberry Pi 3, so I am not personally stuck here. I'm not raising a support issue - but just adding this as a feature request to put on the backlog and prioritise as you see fit.
Hopefully there might be a Docker expert out there who is able to assist.
I see this issue has been raised prior, but I just wanted to point out the recent Docker support for this in case it was not apparent - one no longer needs to publish to various tags for different architectures, as was the previous approach.
https://github.com/home-assistant/home-assistant/issues/9625
So,
This looks like it shouldn't be too much pain. Just waiting for the IBM referenced manifest docker subcommand PR to complete.
I've been playing around locally and have the new docker subcommand running. I can then create a new manifest using only the home assistant AMD64 image and raspberry pi (for now) using the command:
# Create <Manifest> <Image 1 (AMD64 base)> <Image 2 (raspberrypi3 ARM)>
./build/docker manifest create genericstudent/homeassistant:0.58.1 homeassistant/home-assistant:0.58.1 homeassistant/raspberrypi3-homeassistant:0.58.1
Inspecting this: ./build/docker manifest inspect genericstudent/homeassistant:0.58.1 reveals both images are amd64 (no good :cry:).
We resolve this by annotating the raspberrypi3 image to be arm arch:
# Annotate the pi as ARM arch (not done automatically due to other images all having amd64 arch)
./build/docker manifest annotate docker.io/genericstudent/homeassistant:0.58.1 --arch arm homeassistant/raspberrypi3-homeassistant:0.58.1
And finally, push the manifest up to dockerhub:
./build/docker manifest push docker.io/genericstudent/homeassistant:0.58.1
In essence, the manifest is merely a pointer to valid images that can be run on different architechures. I've raised a question over on the discord as to what the official HA docker deployment process looks like for the different image archs as we can include the manifest generation into that process.
This would give us individual repo images that are arch specific, and the root homeassistant/home-assistant image which merely points to the other architectures.
Allowing you to run docker run --rm -it homeassistant/home-assistant:0.58.1 on either ARM (pi) or amd64 (everyone else) and it will just work :copyright: :tm:
Looking into it a little more, I've found that Docker official images use a multiarch jenkins system to build images for many architectures.
It seems we should migrate over to being an official repository, which features a cool checklist for adding new images.
The benefit of this would be simplified build processing of different architectures with automatic image hosting for the various archs.
That would then allow us to simply create a manifest for the homeassistant Dockerhub repo (if the official path doesn't generate this for you automatically) and then we'd have true multi architecture.
@balloob @fabaff Do you guys know anymore on the docker deployment side / if home assistant would be willing to join the official library?
I'm about to cook my own multiarch images using simple framework I created: https://github.com/lobradov/docker-multiarch-builder
but, it would be good if Home-Assistant maintainers would do this in more systematic (and preferably official) way. Adding home-assistant/home-assistant image to library/ would be super-mega-cool.
I totally agree with this. Especially as this would mean @pvizeli wouldn't have to put up with Alpine Linux bugs (which is a bad distro choice anyway) and could simply switch to the multi-arch images for hass.io.
Some more information on this topic can be found here: http://container-solutions.com/multi-arch-docker-images/
I built my own homeassistant multi architecture image a few months ago, you can check it : https://hub.docker.com/r/seblucas/alpine-homeassistant/
That's not advertisement as this image pretty much tailored for my own use and tt won't be usable for anyone else but I've documented how I did it.
Am I missing something or are these already there*. Eg:
https://hub.docker.com/r/homeassistant/raspberrypi3-homeassistant/
*Or should I say, "supposed to be there"? Because when I try and pull any of the RPi images get something like:
# docker pull homeassistant/raspberrypi3-homeassistant
Using default tag: latest
Trying to pull repository docker.io/homeassistant/raspberrypi3-homeassistant ...
manifest for docker.io/homeassistant/raspberrypi3-homeassistant:latest not found
Am I missing something or are these already there*.
A multi-architecture image makes it possible to use the "same" image (= homeassistant/home-assistant) for different architectures, so you don't have to pay attention which image to use on what system. You simply use the same image everywhere.
So this is obviously different from using e.g. the homeassistant/raspberrypi3-homeassistant image, which isn't even "supported" to use outside of hass.io according to their developers...
*Or should I say, "supposed to be there"? Because when I try and pull any of the RPi images get something like:
Docker by default looks for the latest tag in an image if you don't specify it. So the reason you can't pull the image is because the developers from hass.io removed this latest tag from the image on Docker Hub.
So as you can see these are two different issues which unfortunately don't get much attention from the developers of neither home-assistant nor hass.io.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:
I'd like to show my support for multi-arch images; they make it easy to run in a multi-arch docker swarm.
Currently I'm faking this via the following (though I don't have hardware to test aarch64 right now)
TAG="0.77.3"
docker manifest create --amend mannkind/home-assistant:${TAG} homeassistant/home-assistant:${TAG} homeassistant/armhf-homeassistant:${TAG} homeassistant/aarch64-homeassistant:${TAG}
docker manifest annotate mannkind/home-assistant:${TAG} homeassistant/armhf-homeassistant:${TAG} --os linux --arch arm
docker manifest annotate mannkind/home-assistant:${TAG} homeassistant/aarch64-homeassistant:${TAG} --os linux --arch arm64 --variant armv8
docker manifest push --purge mannkind/home-assistant:${TAG}
This would make testing on different architectures also easier (test config on laptop which is amd_64, then deploy it in on raspberry pi 3B).
The GitHub issue tracker is intended for bugs. Since is more of a feature request than a bug report, I'm going to close this. Please post to the feature requests section of the community forums.
Most helpful comment
A multi-architecture image makes it possible to use the "same" image (=
homeassistant/home-assistant) for different architectures, so you don't have to pay attention which image to use on what system. You simply use the same image everywhere.So this is obviously different from using e.g. the
homeassistant/raspberrypi3-homeassistantimage, which isn't even "supported" to use outside of hass.io according to their developers...Docker by default looks for the
latesttag in an image if you don't specify it. So the reason you can't pull the image is because the developers from hass.io removed thislatesttag from the image on Docker Hub.So as you can see these are two different issues which unfortunately don't get much attention from the developers of neither home-assistant nor hass.io.