Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.36 KB

Docker Multi-Platform.md

File metadata and controls

41 lines (26 loc) · 1.36 KB
tags
Docker
TODO

Methods

Using QEMU which is provided with Docker Desktop.

The image used in FROM must be available on the target platform.

Using image provided capabilities to cross-compile.

GOOS and GOARCH for Go build command #Go.

Use ARGs provided by Docker:

Set using --platform flag in build command.

  • BUILDPLATFORM - platform of the host running the build
  • BUILDOS - OS part of the BUILDPLATFORM
  • BUILDARCH - arch part of the BUILDPLATFORM
  • TARGETPLATFORM - target platform
  • TARGETOS - OS part of the TARGETPLATFORM
  • TARGETARCH - architecture part of the TARGETPLATFORM

Examples

go uses different Dockerfile for each arch/OS variant. See: docker library/golang

hello-world uses the same approach: docker-library/hello-world

References