Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aarch64 support #35

Merged
merged 20 commits into from
Dec 4, 2017
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions deb/debian-jessie/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM multiarch/debian-debootstrap:arm64-jessie

# allow replacing httpredir or deb mirror
ARG APT_MIRROR=deb.debian.org
RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
RUN echo "deb http://$APT_MIRROR/debian jessie-backports main" >> /etc/apt/sources.list

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps use arm64v8/debian:jessie-backports ?


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/*

ENV GO_VERSION 1.9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency across arches, this should still be 1.8.3, shouldn't it? (and they should all be updated together?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh duh, there weren't binary releases of Go for arm64 until 1.9 -- makes more sense. 😇

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that may be an issue still; we were holding off bumping to 1.9 as there were still some issues (possibly not for all architectures though); moby/moby#33892

RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local
ENV GOPATH /go
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/github.com/docker && \
mkdir -p /go/src/github.com/opencontainers && \
ln -snf /engine /root/build-deb/engine && \
ln -snf /cli /root/build-deb/cli && \
ln -snf /root/build-deb/engine /go/src/github.com/docker/docker && \
ln -snf /root/build-deb/cli /go/src/github.com/docker/cli


ENV DISTRO debian
ENV SUITE jessie

WORKDIR /root/build-deb

ENTRYPOINT ["/root/build-deb/build-deb"]
32 changes: 32 additions & 0 deletions deb/debian-stretch/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM multiarch/debian-debootstrap:arm64-stretch

# allow replacing httpredir or deb mirror
ARG APT_MIRROR=deb.debian.org
RUN sed -ri "s/(httpredir|deb).debian.org/$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/*

ENV GO_VERSION 1.9
RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local
ENV GOPATH /go
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/github.com/docker && \
mkdir -p /go/src/github.com/opencontainers && \
ln -snf /engine /root/build-deb/engine && \
ln -snf /cli /root/build-deb/cli && \
ln -snf /root/build-deb/engine /go/src/github.com/docker/docker && \
ln -snf /root/build-deb/cli /go/src/github.com/docker/cli


ENV DISTRO debian
ENV SUITE stretch

WORKDIR /root/build-deb

ENTRYPOINT ["/root/build-deb/build-deb"]
16 changes: 4 additions & 12 deletions deb/ubuntu-xenial/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
FROM aarch64/ubuntu:xenial

RUN apt-get update && apt-get install -y golang-go 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 --no-install-recommends && rm -rf /var/lib/apt/lists/*

# Install Go
# We don't have official binary golang 1.7.5 tarballs for ARM64, eigher for Go or
# bootstrap, so we use golang-go (1.6) as bootstrap to build Go from source code.
# We don't use the official ARMv6 released binaries as a GOROOT_BOOTSTRAP, because
# not all ARM64 platforms support 32-bit mode. 32-bit mode is optional for ARMv8.
ENV GO_VERSION 1.8.3
RUN mkdir /usr/src/go && curl -fsSL https://golang.org/dl/go${GO_VERSION}.src.tar.gz | tar -v -C /usr/src/go -xz --strip-components=1 \
&& cd /usr/src/go/src \
&& GOOS=linux GOARCH=arm64 GOROOT_BOOTSTRAP="$(go env GOROOT)" ./make.bash
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 --no-install-recommends && rm -rf /var/lib/apt/lists/*

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

Expand Down
28 changes: 28 additions & 0 deletions deb/ubuntu-zesty/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM multiarch/ubuntu-core:arm64-yakkety

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This for ubuntu zesty, so arm64-yakkety is incorrect image. I think using arm64v8/ubuntu:zesty is would be the best here. arm64v8/ seems to be the closest thing to official debian/ubuntu images and should probably be used elsewhere


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/*

ENV GO_VERSION 1.9
RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local
ENV GOPATH /go
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/github.com/docker && \
mkdir -p /go/src/github.com/opencontainers && \
ln -snf /engine /root/build-deb/engine && \
ln -snf /cli /root/build-deb/cli && \
ln -snf /root/build-deb/engine /go/src/github.com/docker/docker && \
ln -snf /root/build-deb/cli /go/src/github.com/docker/cli


ENV DISTRO ubuntu
ENV SUITE zesty

WORKDIR /root/build-deb

ENTRYPOINT ["/root/build-deb/build-deb"]
2 changes: 2 additions & 0 deletions detect_alpine_image
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if [ "$arch" = "x86_64" ]; then
img="alpine"
elif [ "$arch" = "armv7l" ]; then
img="armhf/alpine"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR shouldn't change the behaviour for other platforms. Probably an artifact of other parallel merges. Upstream already contains the changes for armv7l and aarch64.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, that was the just solved merge conflict

elif [ "$arch" = "aarch64" ]; then
img="arm64v8/alpine"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is already down a few lines 😄

elif [ "$arch" = "s390x" ]; then
img="s390x/alpine"
elif [ "$arch" = "aarch64" ]; then
Expand Down