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

support ARM & ARM64 architectures #38

Closed
kamilmirza opened this issue Mar 21, 2019 · 18 comments
Closed

support ARM & ARM64 architectures #38

kamilmirza opened this issue Mar 21, 2019 · 18 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@kamilmirza
Copy link

as per title
kindly add support for arm and arm64

@thomseddon thomseddon added enhancement New feature or request good first issue Good for newcomers labels Apr 18, 2019
@thomseddon
Copy link
Owner

I will add an arm build to the v2 branch 👍

@thomseddon thomseddon added this to the 2 milestone Apr 18, 2019
@thomseddon
Copy link
Owner

@thomseddon thomseddon modified the milestones: 2, 2.1 Apr 18, 2019
@etho201
Copy link

etho201 commented Sep 28, 2019

Any updates on this? In the meantime I've been able to use the pusher/oauth2_proxy since they do provide an ARM build, but I'm having trouble getting it to work with Traefik v2.

@SuperSandro2000
Copy link
Contributor

Until this is done you can build yourself an arm image by simply modifying the Dockerfile. If you put GOARCH=arm right to the other variables right here https://github.com/thomseddon/traefik-forward-auth/blob/master/Dockerfile#L12 it should work.

@thomseddon
Copy link
Owner

I've added the Dockerfiles but just need to tweak the builds on docker hub, then I'll try to create a manifest :)

@thomseddon thomseddon reopened this Sep 30, 2019
@SuperSandro2000
Copy link
Contributor

I'll try to create a manifest :)

Last time I checked this wasn't possible on Docker Hub. Maybe it is on Cloud?
Also any kind of build especially cross compile is teribble slow on Docker Hub and sometimes takes hours to start and build totaling at over 6 hours just to get a 5 MB Image up.

@etho201
Copy link

etho201 commented Sep 30, 2019

Are you building locally or directly via Docker Hub? I read on another image that ARM variants can be built on x86_64 hardware using multiarch/qemu-user-static.

@thomseddon thomseddon added the help wanted Extra attention is needed label Jan 18, 2020
@thomseddon
Copy link
Owner

So this is stuck as it's not completely obvious how to actually get these built on docker hub....I've found a few examples using qemu, but I don't have a readily available arm setup to test this on - if someone has experience with this and/or an existing environment they can test it in, I would hugely appreciate a PR to get this working!

@SuperSandro2000
Copy link
Contributor

SuperSandro2000 commented Jan 18, 2020

My suggestion would be building it on travis.
It would roughly look like the following. There is an alternative available called buildx but this can't be parallelized in multiple jobs.

  • build each image seperately and push it to docker hub with the tags arm-latest, arm-$VERSION.
  • creating the manifest
docker manifest create traefik-forward-auth:latest arm-latest arm64-latest amd64-latest
  • annotating the manifest
docker manifest annotate traefik-forward-auth:latest traefik-forward-auth:amd64-latest --os linux --arch amd64
docker manifest annotate traefik-forward-auth:latest traefik-forward-auth:arm64-latest --os linux --arch arm64 --variant v8
docker manifest annotate traefik-forward-auth:latest traefik-forward-auth:arm-latest --os linux --arch arm --variant v7
  • pushing the latest and $VERSION manifest
docker manifest push traefik-forward-auth:latest

I am not 100% percent certain I extracted the lines correctly from my old script. If you want you can look at the commit where I removed it from my docker images and later replaced it with docker buildx. SuperSandro2000/docker-images@6c274c2

Let me know if this is what you want or if you want to use the newer buildx approach which is way nicer but requires a local docker registry if you don't want to push tests to the official repository.

@julien-vu
Copy link

julien-vu commented Feb 17, 2020

@thomseddon just tried your dockerfile on ARM (rasp4) and it returned a non-zero code.

EDIT: NVM i used the tag 2.1-arm , golden

@Sigi-cz
Copy link

Sigi-cz commented Apr 14, 2020

@julien-vu Could You please provide the docker build command You used? I still get the non-zero return code when building and can't figure out how to fix it.

go: finding github.com/thomseddon/traefik-forward-auth v0.1.1
go: downloading github.com/thomseddon/traefik-forward-auth v0.1.1
go: extracting github.com/thomseddon/traefik-forward-auth v0.1.1
can't load package: package github.com/thomseddon/traefik-forward-auth/cmd: module github.com/thomseddon/traefik-forward-auth@latest found (v0.1.1), but does not contain package github.com/thomseddon/traefik-forward-auth/cmd
The command '/bin/sh -c CGO_ENABLED=0 GOOS=linux GOARCH=arm GO111MODULE=on go build -a -installsuffix nocgo -o /traefik-forward-auth github.com/thomseddon/traefik-forward-auth/cmd' returned a non-zero code: 1

@thomseddon thomseddon removed this from the 2.1 milestone Apr 16, 2020
@thomseddon
Copy link
Owner

@Sigi-cz it looks like you're pulling v0.1.1, but you will want to pull 2 or 2.1 👍

@Sigi-cz
Copy link

Sigi-cz commented Apr 16, 2020

@thomseddon I know, but I'm not familiar enough with docker to figure out how to pull the latest commit.
This is the command I used:

docker build https://raw.githubusercontent.com/thomseddon/traefik-forward-auth/master/Dockerfile.arm

But I got it working in the end. I downloaded the zip, unpacked and ran this:

docker build -t thomseddon/traefik-forward-auth:arm -f traefik-forward-auth-master/Dockerfile.arm traefik-forward-auth-master/

Maybe You could add little 'how to compile for arm' into the Readme?

@veverkap
Copy link

I'm happy to try and set something up to automated this - I've got a bunch of 32bit Raspbians here.

You can also try docker buildx

@thomseddon thomseddon added this to the 2.2 milestone Apr 23, 2020
@Beanow
Copy link

Beanow commented Aug 16, 2020

For Docker Swarm mode this doesn't work correctly.

In spite of the -arm labels the OS/ARCH picked up by Docker is amd64.
DockerHub reports this as well on thomseddon/traefik-forward-auth:2-arm
As opposed to say npawelek/traefik-forward-auth:v2.2.0

Assuming their image relates to #112

A direct docker run command will run it.

$ uname -m
armv7l

$ docker run --rm thomseddon/traefik-forward-auth:2-arm --help
Usage:
  traefik-forward-auth [OPTIONS]
...

But deploying a stack like:

version: '3.4'
services:
  fw-auth:
    image: thomseddon/traefik-forward-auth:2-arm
    command: --help
    deploy:
      mode: global

Creates a task similar to this: docker inspect <taskID>

Note: Spec.Placement.Platforms winds up as linux/amd64.

[
    {
        ...
        "Spec": {
            "ContainerSpec": {
                "Image": "thomseddon/traefik-forward-auth:2-arm@sha256:c633d20c76c64b4bcdfce5f6c274c00a4fe1efe092348801a560c43c4c1415af",
                "Labels": {
                    "com.docker.stack.namespace": "fwa"
                },
                "Args": [
                    "--help"
                ],
                "Privileges": {
                    "CredentialSpec": null,
                    "SELinuxContext": null
                }
            },
            "Resources": {},
            "Placement": {
                "Platforms": [
                    {
                        "Architecture": "amd64",
                        "OS": "linux"
                    }
                ]
            },
            "Networks": [
                {
                    "Target": "45aukoqbi64nhg1tepayn0vc6",
                    "Aliases": [
                        "fw-auth"
                    ]
                }
            ],
            "ForceUpdate": 0
        },
        "ServiceID": "xzz2j07wceuynam080ksba87q",
        "NodeID": "r7lspnr6dqp5715gzpx56y27v",
        "Status": {
            "Timestamp": "2020-08-16T19:40:49.0845814Z",
            "State": "pending",
            "Message": "unsupported platform on 1 node",
            "ContainerStatus": {},
            "PortStatus": {}
        },
        ...
    }
]

@SuperSandro2000
Copy link
Contributor

@Beanow Docker Hub can't do manifests easily. If the Image building would be done on some other CI this would be easily possible.

@cottonstar
Copy link

Just switched to RPI4 and getting this error - is there a workaround?
oauth The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

@jd-apprentice
Copy link

Just switched to RPI4 and getting this error - is there a workaround? oauth The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Probably building the image yourself for that platform?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

10 participants