qoomon / docker-host

A docker sidecar container to forward all traffic to local docker host or any other host
MIT License
1.1k stars 88 forks source link

Build for ARM #35

Closed pathob closed 4 years ago

pathob commented 4 years ago

Hi, it would be very nice if you could also build your image for ARM. Thank you!

qoomon commented 4 years ago

How to?

qoomon commented 4 years ago

like this https://www.docker.com/blog/getting-started-with-docker-for-arm-on-linux/?

pathob commented 4 years ago

I guess yes. The other approach might be to use an ARM container in travis for building, but I don't know how the tagging is done then in order to get a result like this: https://hub.docker.com/_/alpine?tab=tags

Unfortunately, I don't have experience with deploying Docker images or building for other architectures.

My current solution is to just build your image directly on ARM and that works fine. So at least I can confirm there are no architecture-specific changes necessary.

sdemets commented 4 years ago

There are plenty of how-to's out there on building cross platform images, but here's how I do it to build python based images (FROM python) for my PC and Raspberry Pi in one go on my Windows 10 machine: You first need to enable docker buildx (experimental CLI). Check docker documentation on how to do that for your platform.

docker buildx create --name rpibuilder docker buildx use rpibuilder docker buildx inspect --bootstrap docker buildx build --platform linux/amd64,linux/arm/v7 -t \<imagename>:\<tag> \<path to dockerfile> --push docker buildx imagetools inspect \<imagename>:\<tag>

The last line is just to check if all went well.

Hope this helps!

qoomon commented 4 years ago

Oh nice. Will try to add it to github action deploy pipeline.

qoomon commented 4 years ago

enable experimental features is easy as export DOCKER_CLI_EXPERIMENTAL=enabled :-D

sdemets commented 4 years ago

If you have Docker Desktop, just go to settings -> command line and set "Enable experimental features" to on.

qoomon commented 4 years ago

just released qoomon/docker-host:latest and qoomon/docker-host:2.4.2 to dockerhub for following platforms