Dockerhub Packaging and Publishing
Producing multi-architecture repos on hub.docker.com
For this guild, I’ll be using an AMD64 and
ARM64 architecture for a project named
my-project. I’ll be using the hub.docker username:
red
.
1. Create repos for each target architecture
Create the images with the tag names:
- red/my-project-amd64
- red/my-project-arm64
2. Build the images locally
AMD64
docker build \
--tag red/my-project-amd64:latest \
--platform linux/amd64 .
ARM64
docker build \
--tag red/my-project-arm64:latest \
--platform linux/arm64/v8 .
3. Push the images
AMD64
docker push red/my-project-amd64:latest
ARM64
docker push red/my-project-arm64:latest
4. Create manifest
docker manifest create red/my-project:latest \
red/my-project-arm64:latest \
red/my-project-amd64:latest
5. Push manifest
docker manifest push red/my-project:latest