Why does the k8s.gcr.io/kube-proxy Docker image 'work' on multiple architectures?

7/28/2019

Running

docker run -it -v $PWD:/tmp k8s.gcr.io/kube-proxy:v1.15.1 cp /usr/local/bin/kube-proxy /tmp
file kube-proxy

gives a different result depending on which architecture I am on e.g. on CoreOS

Container Linux by CoreOS stable (2135.5.0)
core@node1 ~ $ file kube-proxy
kube-proxy: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped

and on HypriotOS

HypriotOS/armv7: pirate@pirate1.lukeaddison.co.uk in ~
$ file kube-proxy
kube-proxy: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped

How is this working?

-- dippynark
docker
google-container-registry
kube-proxy
kubernetes

1 Answer

7/28/2019

Container runtimes are architecture aware & container registries support defining images for multiple architectures. Docker automatically pulls the correct image for the platform it's running on.

https://blog.docker.com/2017/09/docker-official-images-now-multi-platform/

-- johnharris85
Source: StackOverflow