Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Add image support for various arm archs (v5,6,7) #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add image support for various arm archs (v5,6,7) #69

wants to merge 2 commits into from

Conversation

chrisbraucker
Copy link

What does this PR do?

This PR adds native build support for the arch architectures v5, v6, v7 in that it checks versions more fine-grainedly and references official traefik binaries for those versions.

Motivation

It was not possible for me to run the docker build on my Raspberry Pi 3 because apk --print-arch spits out 'armv7', but the bash case operation only allows the generic 'armhf', which in turn results in the backwards-compatible 'armv6' binary.
As Traefik actually releases binaries for particular arm architectures, specifically armv7 needed here, I updated the Dockerfile to make local builds possible.
This should not interfere with the build-pipeline at all, though I would appreciate the addition of armv7 images.

Traefik releases supported versions not only for armhf, but also for armv5, 6 and 7.
If the image is built on e.g. a raspberry pi 3, the step to determine supported arch fails and the image is not built.
With this change it is possible to build actual native images with support by official traefik binaries.
@joerggollnick
Copy link

Is it possible to add your line to tmplv1.Dockerfile and tmplv2.Dockerfile?
Thanks?

As requested in #69, adds support
into versioned Dockerfiles, too.
@chrisbraucker
Copy link
Author

Always happy to help. Hope this is complete now :)

@klausondrag
Copy link

Thanks chris, this is what I've been looking for. I can confirm it works on my Raspberry Pi 3B+. Any updates on when this will get merged? Will this also result in the images being pushed to docker hub automatically or are more steps needed?

@JulioC
Copy link

JulioC commented Sep 6, 2020

This also works for me, using Hypriot OS on Raspberry Pi 3B+.

Please note that the current behavior is to fail with an unhelpful message:

Error loading shared library ▒▒▒▒z▒▒▒▒▒o▒▒▒▒▒▒▒▒▒▒▒▒▒^O^▒▒_▒▒▒▒▒#▒▒▒▒▒▒▒▒O▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒߿~o▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒_▒▒▒^▒▒_▒▒▒▒▒: No such file or directory (needed by /entrypoint.sh)

image


If anyone need a quick workaround, I've used this standalone Dockerfile to build a custom image for 2.2.10:

FROM alpine:3.11
RUN apk --no-cache add ca-certificates tzdata
RUN set -ex; \
	apkArch="$(apk --print-arch)"; \
	case "$apkArch" in \
		armhf) arch='armv6' ;; \
        aarch64) arch='arm64' ;; \
        armv[567]) arch="$apkArch" ;; \
		x86_64) arch='amd64' ;; \
		*) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \
	esac; \
	wget --quiet -O /tmp/traefik.tar.gz "https://github.com/containous/traefik/releases/download/v2.2.10/traefik_v2.2.10_linux_$arch.tar.gz"; \
	tar xzvf /tmp/traefik.tar.gz -C /usr/local/bin traefik; \
	rm -f /tmp/traefik.tar.gz; \
	chmod +x /usr/local/bin/traefik
RUN wget --quiet -O /entrypoint.sh "https://raw.githubusercontent.com/containous/traefik-library-image/5920a9c73cb53b985a535a4b8cfbb98dc2f08ad6/alpine/entrypoint.sh"; \
	chmod +x /entrypoint.sh
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
CMD ["traefik"]

# Metadata
LABEL org.opencontainers.image.vendor="Containous" \
	org.opencontainers.image.url="https://traefik.io" \
	org.opencontainers.image.title="Traefik" \
	org.opencontainers.image.description="A modern reverse-proxy" \
	org.opencontainers.image.version="v2.2.10" \
	org.opencontainers.image.documentation="https://docs.traefik.io"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants