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

feat(arm): Cross build arm and arm64 docker images #37

Merged
merged 2 commits into from Feb 4, 2019
Merged

feat(arm): Cross build arm and arm64 docker images #37

merged 2 commits into from Feb 4, 2019

Conversation

karlskewes
Copy link
Contributor

@karlskewes karlskewes commented Feb 1, 2019

Description

  • Add additional .arm64 and .armv6 Dockerfiles
  • .gitignore release/ directory

Could be tidied by looping arch's in Makefile and creating a multi-arch manifest (requires docker cli experimental features enabled).

Motivation and Context

Second half of #16

How Has This Been Tested?

make release
make docker-all

$ docker inspect pusher/oauth2_proxy:latest{,-amd64,-arm64,-armv6} | grep Arch
        "Architecture": "amd64",
        "Architecture": "amd64",
        "Architecture": "arm64",
        "Architecture": "arm",

Run docker image on RPi 3B:

karl@pi1:~ $ docker run pusher/oauth2_proxy:latest-armv6 -version
oauth2_proxy v3.0.0-18-g2bdf00a-dirty (built with go1.11.5)
karl@pi1:~ $ docker run pusher/oauth2_proxy:latest-armv6 
2019/02/01 20:33:47 main.go:107: Invalid configuration:
  missing setting: cookie-secret
  missing setting: client-id
  missing setting: client-secret
  missing setting for email validation: email-domain or authenticated-emails-file required.
      use email-domain=* to authorize all email addresses

Run docker image on Rock64:

rock64@k8s-w-01:~$ sudo docker run pusher/oauth2_proxy:latest-arm64 -version
oauth2_proxy v3.0.0-18-g2bdf00a-dirty (built with go1.11.5)
rock64@k8s-w-01:~$ sudo docker run pusher/oauth2_proxy:latest-arm64 
2019/02/01 20:34:44 main.go:107: Invalid configuration:
  missing setting: cookie-secret
  missing setting: client-id
  missing setting: client-secret
  missing setting for email validation: email-domain or authenticated-emails-file required.
      use email-domain=* to authorize all email addresses

Checklist:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.

@karlskewes karlskewes requested a review from a team February 1, 2019 23:14
- Requires `qemu-user-static`, added to travis - maybe incorrect?
- Add build guide
- `.gitignore` `release/` directory
Dockerfile.armv6 Outdated Show resolved Hide resolved
Copy link
Member

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

TIL you can run arm containers on docker for mac and it doesn't complain at you.

I have no way of testing these until I get back to the office on monday but from my understanding they seem sane and the containers I've built claim to be arm, so if you're confident that they work I'm happy to merge

@karlskewes
Copy link
Contributor Author

Wow, I haven't seen that before. But I do get the same behaviour running arm64 binary on amd64.

Doesn't work the other way though, amd64 binary on arm:

karl@pi1:~ $ ./oauth2_proxy-linux-amd64 
-bash: ./oauth2_proxy-linux-amd64: cannot execute binary file: Exec format error

rock64@k8s-w-01:~$ ./oauth2_proxy-linux-amd64 
-bash: ./oauth2_proxy-linux-amd64: cannot execute binary file: Exec format error

Otherwise yeah I think this is good to go. No rush if you want to wait until back in office.

@JoelSpeed
Copy link
Member

Just tested this on a Pi V3 and it looks like it's working to me, so happy for this to get merged!

Thanks @kskewes

@JoelSpeed JoelSpeed merged commit 92c4424 into oauth2-proxy:master Feb 4, 2019
@karlskewes karlskewes deleted the dockerarm branch February 8, 2019 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants