mprimeaux commented on issue #139:
URL: https://github.com/apache/age/issues/139#issuecomment-1414519128

   I managed to work through what is needed to build a single OCI-compliant 
multi-stage, multi-architecture container image using `nerdctl` and `qemu` that 
produces a substantially smaller image. 
   
   ```shell
   nerdctl images
   
   REPOSITORY                                  TAG       IMAGE ID        
CREATED              PLATFORM          SIZE         BLOB SIZE
   apache/age                                  latest    f228f7fc52b2    About 
an hour ago    linux/amd64       914.2 MiB    322.3 MiB
   localhost:5000/apache/age                   latest    1a3b9c5f2ae0    11 
seconds ago       linux/arm64       366.4 MiB    127.1 MiB
   localhost:5000/apache/age                   latest    1a3b9c5f2ae0    11 
seconds ago       linux/amd64       0.0 B        131.8 MiB
   ```
   
   The first image (above) is the 
[latest](https://hub.docker.com/layers/apache/age/latest/images/sha256-f228f7fc52b20d467090b5bc5375acd6aaa00a182cb0d7d08c49e1f0f6ec49fe?context=explore)
 AGE image on DockerHub. The second two lines represent the single OCI manifest 
containing both `linux/amd64` and `linux/arm64` images.
   
   As you can see, the size was reduced from 914 MiB / 322 MiB to effectively 
127.1 MiB (arm64) and 131.8 MiB (amd64). For comparison, this is slightly 
larger than the official postgres container images, which is expected given the 
final layer:
   
   ```shell
   REPOSITORY                                  TAG       IMAGE ID        
CREATED              PLATFORM          SIZE         BLOB SIZE
   postgres                                    14        36c7e29b775b    About 
an hour ago    linux/amd64       383.8 MiB    131.6 MiB
   postgres                                    14        36c7e29b775b    About 
an hour ago    linux/arm/v5      0.0 B        125.2 MiB
   postgres                                    14        36c7e29b775b    About 
an hour ago    linux/arm/v7      0.0 B        120.1 MiB
   postgres                                    14        36c7e29b775b    About 
an hour ago    linux/arm64/v8    365.7 MiB    126.9 MiB
   postgres                                    14        36c7e29b775b    About 
an hour ago    linux/386         0.0 B        133.1 MiB
   ```
   
   I'm still getting my head around the CI process in this repository but more 
to come. I'm very keen to ensure we build container images (where possible) for 
[all 
platforms](https://github.com/containerd/nerdctl/blob/main/docs/multi-platform.md)
 supported by QEMU assuming folks here are also supportive of this direction.
   
   Please let me know.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to