Challenge
DifficultyMedium
Learner activity128 solved of 255 attempts

Build and Push an Uncompressed Container Image

Learn how to build and publish an uncompressed container image - a helpful trick to optimize disk I/O for large images, especially when you can benefit from a fast internal network.

Premium Challenge

Upgrade your membership to unlock this and all other premium materials.

Upgrade

Container images are usually stored and transferred as compressed tarballs (tar+gzip or tar+zstd). It improves the storage efficiency on the registry side and also decreases the pull/push time.

However, sometimes uncompressing the images on the client can become the bottleneck. For instance, with large ML/LLM images transferred over a fast internal network, the local disk I/O during the decompression can become the actual limiting factor ( 1, 2 ).

In this challenge, you will practice building and publishing an uncompressed container image.

You can find the application you need to package at ~/app. It already comes with a Dockerfile, so you won't have to write one from scratch. Using this Dockerfile, build a container image and publish it to the remote repository registry.iximiuz.com/app using the v1.0.0 tag.

The pushed image should not be compressed.

Hint 1

By default, docker build and docker push produce an image with gzip-compressed layers. To get a different layer format, look into the --output flag of docker buildx build (docker build is an alias for it), in particular its exporter capabilities.

Hint 2

The image exporter can push the build result straight to the remote repository. Check out the type and push parameters of the --output flag.

Hint 3

The --output parameter you're looking for is called compression. The docs mention only the gzip, estargz, and zstd variants, but there is one more option - uncompressed.

Hint 4

BuildKit reuses existing layer blobs as is. The base image layers come from the registry already compressed, and the cached layers of your earlier builds keep the compression they were built with. To convert all layers, add force-compression=true to the --output flag.

Problem
Solution
Start
Black Friday