# Let's build the smallest possible Docker image

DevFeed: [Let's build the smallest possible Docker image](<https://devfeed.tech/articles/let-s-build-the-smallest-possible-docker-image-29462.md>)

Original publisher: [Read original article](<https://blog.hypriot.com/post/build-smallest-possible-docker-image/>)

Published: 2017-02-22T08:18:35Z

Content type: tutorial

Language: en

Sources: [Hypriot](<https://devfeed.tech/sources/hypriot.md>)

Topics: [Docker](<https://devfeed.tech/topics/docker.md>), [Docker Image](<https://devfeed.tech/topics/docker-image.md>), [Internet of things](<https://devfeed.tech/topics/iot.md>), [Raspberry Pi](<https://devfeed.tech/topics/raspberry-pi.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [Arm](<https://devfeed.tech/topics/arm.md>), [Code](<https://devfeed.tech/topics/code.md>), [Deployment](<https://devfeed.tech/topics/deployment.md>)

Tags: [arm](<https://devfeed.tech/tags/arm.md>), [assembly](<https://devfeed.tech/tags/assembly.md>), [code](<https://devfeed.tech/tags/code.md>), [devops](<https://devfeed.tech/tags/devops.md>), [docker](<https://devfeed.tech/tags/docker.md>), [docker-image](<https://devfeed.tech/tags/docker-image.md>), [iot](<https://devfeed.tech/tags/iot.md>), [linux](<https://devfeed.tech/tags/linux.md>), [raspberry-pi](<https://devfeed.tech/tags/raspberry-pi.md>)

## AI overview

This tutorial explores building very small Docker images for IoT devices with limited memory, storage, CPU capacity, and network connectivity. It describes using a statically linked ARM assembly binary that runs as a single Linux process in a Docker container, with build instructions available in a public GitHub repository.

## Source excerpt

Imagine what happens if we're starting to use Docker containers on IoT devices. On small and slow devices with limited system resources and connected via a damn slow network connection we do have to care differently on how to build and ship our apps. In these circumstances it pays off and it's absolutely essential to optimize our applications and the resulting Docker images for size. SIZE DOES MATTER If we're doing it right we'll get a lot of benefits such as blasting fast download speed for updating to a new or more secured version. On wireless networks we are also reducing the costs for data transfers as well. According to my tweet I'd like to start a new Docker challenge: How small is the smallest Docker image we could build, which prints a "Hello Docker World!"? Background Sometimes developing directly on an IoT device can be pretty hard or nearly impossible due to the lack of enough system resources. These resources can be the amount of memory, disk space or CPU capacity - or it can be just a limited network connectivity over a low-bandwith 64kbit/sec wireless network. So, let's assume we do have a Raspberry Pi already deployed in the field and this IoT device has such a low-bandwidth network connection. We're preparing our developing system to run on a bare-metal cloud server and we are transfering our build artefacts as ready-to-run Docker images regularly with each and every new release in a DevOps driven manner. For this reason we'd like to speed up the deployment with minimized Docker image sizes. Wait, I thought a Docker image can be pretty heavy with up to 1 GByte or even larger? Well, that could happen if we're packing a whole Operating System like Ubuntu or Debian into our Docker images. But as we're building an IoT application we should take care about that situation. A Docker image can instead be build with an app consisting of a statically linked binary and when we start it as a Docker container it will run a single Linux process only. Creating our