Creating a Docker image that contains everything you need to build and develop your firmware project is a great first step to a robust and portable build environment. The next step is using a Docker Registry to easily share that image. A Docker Registry is a service that allows users to share Docker images using the docker push
and docker pull
commands.
A number of companies offer a Docker Registry as a hosted service, including Docker, GitHub, AWS, and Microsoft. In this example we'll demonstrate using Docker Hub as our registry.
Before diving in, if you're not familiar with Docker, or why it's such a powerful tool for embedded engineers check out this post on Docker for embedded engineering:
https://www.lagerdata.com/articles/an-introduction-to-docker-for-managing-build-environments
We'll start by locally building a build environment for the nRF52 family of MCUs from Nordic using this publicly hosted DockerFile:
Now if we run docker image ls
we should see the following
You'll notice the image was tagged with version 1.3
. We chose this value because that aligns with the git tag
version of the Dockerfile used to build this image.
Now go to hub.docker.com and create an account.
There are 4 tiers Free
, Pro
, Team
, and Large
.
https://www.docker.com/pricing
The Free
plan offers unlimited public repositories (and 1 private repository) which is good enough to get started.
Use the credentials you just created for you Docker Hub account to login to the Docker Hub registry. In this case, the username is adhanali
.
Next you'll need to re-tag your docker image by pre-fixing it with your user account name. In this case we want to retag the image from devenv-cortexm-nrf52
to adhanali/devenv-cortexm-nrf52
.
The last step is to push
your image to the registry
Now, if you go back to your Docker Hub account you should see something like

If someone else on your team wants to use this image to start developing a project they simply need to run docker pull adhanali/devenv-cortexm-nrf52:version-1.3
and that's it!
Another really nice feature of Docker Hub is that it allows you to link your DockerFile in GitHub (or BitBucket, GitLab, etc) to an image in your Docker Hub account. Once linked, every time you push a change to your Dockerfile, Docker Hub will automatically trigger a re-build of your image. You can even set tagging rules so that Docker Hub will auto-tag your image based the rules you give it. We'll go over how to link your Docker File to your Docker Hub account and trigger automatic builds in a later post.