Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Packaging Docker aarch64 for Debian Stretch. (On

Deploy a server to

Type 2A - Ubuntu 17.04

ssh into it.

Install Docker. (Yes we use Docker to build Docker)

This is a old docker, but It's good for us. apt install

git clone
cd docker-ce/
git checkout 17.07

Create the Dockerfile components/packaging/deb/debian-stretch/Dockerfile.aarch64

FROM arm64v8/debian:stretch

# allow replacing httpredir or deb mirror
RUN sed -ri "s/(httpredir|deb)$APT_MIRROR/g" /etc/apt/sources.list

RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libseccomp-dev pkg-config vim-common libsystemd-dev gnupg dirmngr --no-install-recommends && rm -rf /var/lib/apt/lists/*

RUN curl -fSL "${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
ENV RUNC_BUILDTAGS apparmor seccomp selinux

COPY common/ /root/build-deb/debian
COPY build-deb /root/build-deb/build-deb

RUN mkdir -p /go/src/ && \
        mkdir -p /go/src/ && \
        ln -snf /engine /root/build-deb/engine && \
        ln -snf /cli /root/build-deb/cli && \
        ln -snf /root/build-deb/engine /go/src/ && \
        ln -snf /root/build-deb/cli /go/src/

ENV SUITE stretch

WORKDIR /root/build-deb

ENTRYPOINT ["/root/build-deb/build-deb"]

Let's build!

make deb DOCKER_BUILD_PKGS=debian-stretch

Get your .deb at: components/packaging/deb/debbuild/debian-stretch/

$ ls components/packaging/deb/debbuild/debian-stretch/
docker-ce_17.10.0~ce-0~debian_arm64.buildinfo  docker-ce_17.10.0~ce-0~debian_arm64.changes  docker-ce_17.10.0~ce-0~debian_arm64.deb  docker-ce_17.10.0~ce-0~debian.dsc  docker-ce_17.10.0~ce-0~debian.tar.gz

Now, let's install our brand new Docker

(I'm installing on my Rock64 board)

# Since we don't have an aarch64 package (

wget -O docker.deb

# Dependencies
apt-get install libapparmor1 libltdl7 libseccomp2

dpkg -i docker.deb
rm docker.deb

This comment has been minimized.

Copy link
Owner Author

douglasmiranda commented Nov 3, 2017

screen shot 2017-11-03 at 17 07 54


This comment has been minimized.

Copy link

vielmetti commented Nov 3, 2017



This comment has been minimized.

Copy link

chestercs commented Dec 13, 2017



This comment has been minimized.

Copy link

olihey commented May 5, 2018

Awesome, thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.