This post provides the steps required to build the Docker daemon for 32-bit Linux platforms.
Background
Software today is driven by speed – move fast, learn fast, and deliver fast! Nirmata, my company, enables software developers to move fast by making it super easy to deploy, operate, and optimize their containerized applications. Nirmata builds on Docker, the most popular container technology around. Docker is commonly used in x64 architectures and with popular Linux distros’ like Ubuntu, RHEL, CoreOS. However, there continues to be a steady demand for deploying container on other platforms and architectures like Yocto, Kali Linux and 32-bit architectures.
At Nirmata, we are working with a customer in the IoT space who required a 32-bit Docker daemon. Although Docker continues to add support for many platforms and architectures, it does not seem like official 32-bit support is coming anytime soon (issue #136). There is an existing blog post, which helps build Docker on 32-bit platform, but a lot has changed in Docker world since then.
In this post, I have documented the steps I used to build and use Docker on 32-bit platforms:
Overview
Docker docs provide a well-detailed instructions set for setting up a dev environment, however, it doesn’t provide any instructions to build Docker daemon for 32-bit platform.
Docker provides a Dockerfile in the root directory of its Git repository for building a Docker dev environment. The Dockerfile builds a base image; which has all the tools and binaries required for building Docker daemon binary. For building a daemon compatible with 32-bit, one can follow the same steps what Docker doc suggests, with the following changes to the Dockerfile.
- Use 32-bit Ubuntu image as the base image
- Use clang-3.6 version
- Install Go for 32 bit platform
Note: These steps are tested on Ubuntu virtual machine with at least 2GB memory, but should work the same on any x86_64 Linux distribution.
Detailed Steps
Here are the complete steps to build a 32-bit Docker daemon from Docker Github branch:
- Install git
$ sudo apt-get install git-all
- Install make
$ sudo apt-get install build-essential
- To install Docker, follow this tutorial:
https://docs.docker.com/engine/installation/ubuntulinux/
- Get Docker Source Code
$ git clone https://github.com/docker/docker.git $ cd docker/ $ mv Dockerfile Dockerfile.backup
- wget the Dockerfile to create 32-bit container
$ wget https://gist.githubusercontent.com/prateekgogia/05f058bafbccc2478fcc/raw/1db60ea471678cfb55185215defcf371f7dcec1d/Dockerfile
- We can now build the Docker build environment. This will create a Docker-dev image with all the required tools. Running this command for the first time will take sometime.
$ make build
- Once the command completes, run ‘Docker images’ and it should show a Docker-dev image. This image has all the tools and binaries required to build Docker daemon. Now, we can build a 32-bit Docker daemon using docker-dev container image
$ make binary
A docker binary for 32-bit platform will be generated in directory – “bundles/latest/binary”.
A 32-bit Docker daemon will only support 32-bit container images. There are a few 32-bit images available on Docker hub. If you are using Go, you can also create a static container with a 32-bit binary to run images on 32-bit Linux Platform.
Summary
It’s a great time to be a software developer, and at Nirmata we are excited to be building a platform that empowers developers by allowing them to focus on their applications, while we help take care of the heavy lifting for applications operations and management.
I hope this brief post helps you with your software adventures! For any further questions feel free to reach out to me at: prateek@nirmata.com.
UPDATE (April/18/2017): There has been lot of updates to Docker build procedure since this post, this was original written with 1.9.* Docker version. I have updated the Dockerfile provided above for the current Docker version 17.04.0-ce.
PS- Latest build procedure doesn’t support OSX cross compilation for Docker and CRIU binary, which are available in upstream Dockerfile in Docker repo.

For more updates and news follow us at:
Ferri
March 27, 2016 at 2:30 pmCame from stackoverflow and read about this, since my old laptop doesn’t support 64 bit, so i still find a way to run docker, luckily i found this post
Thanks
Prateek Gogia
March 27, 2016 at 4:05 pmGlad you find it useful 🙂
Divya Neela
March 12, 2018 at 12:55 pmhi,
this code is working upto docker file to create 32 bit container.$make buld its showing no rule to make target build,could u please help me why???
Rai Hann
April 27, 2016 at 7:05 pmIs there a way to build the 32-bit binaries without ‘SSE’ instructions being built into the resulting executables ? When GOARCH=387 is exported, the resulting binaries are 64-bit ELF.
Prateek Gogia
April 27, 2016 at 8:29 pmHi Rai
Are you setting GOARCH in the Dockerfile? I tried setting this option as GO386=387, which is specified in GoLang Docs https://golang.org/doc/install/source and it build a 32-bit binary. Which version of Docker are you trying to build ?
Thanks
Prateek
check broken links
April 29, 2016 at 9:39 pmHi Prateek,
I’m trying to build docker 1.12 for i586. The binaries that your Dockerfile creates do not work on my target. I did try GOARCH=386 , GO386=387 but setting GOARCH=386 breaks the docker build (reports no buildible binaries in the docker vendor source tree.).
Sudhir
February 16, 2017 at 1:32 amGetting below error when executing make build-
hack/make/.detect-daemon-osarch: line 11: docker: command not found
hack/make/.detect-daemon-osarch: line 11: docker: command not found
hack/make/.detect-daemon-osarch: line 11: docker: command not found
hack/make/.detect-daemon-osarch: line 11: docker: command not found
docker build -t “docker-dev:master” -f “Dockerfile” .
/bin/sh: 1: docker: not found
Makefile:96: recipe for target ‘build’ failed
make: *** [build] Error 127
not sure why. can you help on this?
Rahul
March 16, 2017 at 10:33 amit is necessary to add the user to the docker group
sudo usermod -aG docker $(whoami)
Rahul
March 17, 2017 at 10:31 amI do not have any previous experience in Go.Can anyone please help me with the error as it is not able to find any package.
Building: bundles/17.05.0-dev/binary-client/docker-17.05.0-dev
cli/command/plugin/upgrade.go:4:2: cannot find package “context” in any of:
/usr/local/go/src/context (from $GOROOT)
/go/src/context (from $GOPATH)
/go/src/github.com/docker/docker/vendor/src/context
pkg/jsonmessage/jsonmessage.go:11:2: cannot find package “github.com/Nvveen/Gotty” in any of:
/usr/local/go/src/github.com/Nvveen/Gotty (from $GOROOT)
/go/src/github.com/Nvveen/Gotty (from $GOPATH)
/go/src/github.com/docker/docker/vendor/src/github.com/Nvveen/Gotty
kr
April 3, 2017 at 8:14 amI was able to build docker for 32bit debian, but every time I run “docker run …” I get “grpc: the connection is unavailable”. The daemon seems to be running. Anyone else encountered that?
kr
April 5, 2017 at 10:10 amResolved the “gprc” issue by not using the supplied Dockerfile, but using the official one, and simply replacing base image and architecture from am64 to i386 for tools.
hernino
April 10, 2017 at 1:46 amCan someone help me with the following errors:
docker build -t “docker-dev:master” -f “Dockerfile” .
/bin/sh: 1: docker: not found
make: *** [build] Error 127
I have followed all the steps. I am runniging ubuntu 14
hernino
April 10, 2017 at 1:43 amI have followed all the steps but I am getting the following error:
docker build -t “docker-dev:master” -f “Dockerfile” .
/bin/sh: 1: docker: not found
make: *** [build] Error 127
Michael Orishich
December 16, 2018 at 1:47 pmYou need to do it on an officially Docker-supported machine. Then you just copy over the binaries to the machine you want to install Docker on and you got Docker.
Inyong Gill
July 25, 2019 at 11:35 amHello Prateek,
I was trying to build armv5 32bit docker binary
but It doesn’t work How can I solve this problem?
Jim Bugwadia
August 25, 2019 at 6:30 pmHi Inyong,
We have not looked at this in a while, so do not gave any additional information. If you find a solution, please feel free to add to the comments for other users. Thanks,
Jim