Build container Mac ARM
This document will explain how to build containers on you Silicon Mac using Podman. Publishing containers to Dockerhub/Github repo, also building containers that are X86 compatible
Architecture
Building and running containers and running them on cloud comes with some challenges. To start with most container orchestrations are build on X86 servers, though there are more services starting to offer ARM servers. AWS Graviton instances are ARM based, and Karpenter autoscaler on EKS supports provisioning of Graviton instances. Another thing to consider is when you build and push the container to the registry for Deployments. If you are on Silicon Mac, by default container is built for ARM architecture. You must make sure to specify architecture during build process if intending to build X86 compatible containers.
Tooling Podman
Docker containers are licensed product if you are trying to install on Business desktop. A good alternative is to use Podman which is compatible with other OCI compliant container formats including Docker. It is lightweight, secure and Opensource.
Build container (X86 Architecture)
-
create a Dockerfile with necessary instructions
-
Build container for respective Arch
-
Test pod locally
-
Log on to registry.
Build image from modified container
Sometimes you make updates to container and like to build an image from the modified container.
# List and identify your container
podman ps -a
# Create a commit from updated pod
podman commit myapp