Opa: Publish arm64 binaries and container images

Created on 28 Mar 2020  路  4Comments  路  Source: open-policy-agent/opa

Expected Behavior

It would be great if it was possible to run open-policy-agent on arm64 architecture, via multi arch container images (https://docs.docker.com/engine/reference/commandline/manifest/#create-and-push-a-manifest-list)

Muliarch images show on dockerhub:

image

Those images seamlessly run on supported architectures

feature-request help wanted packaging

Most helpful comment

I think there are a few things we'd want to do to add support:

  • Add arm binaries to be part of the "release" Makefile target(s)
  • Add support for publishing multi-arch images
  • Update travis to build/push the arm binaries with the others

All 4 comments

This should already be supported by just specifying the GOARCH option and building OPA from source.

Ex:

$ make build GOARCH=arm64 GOOS=linux
make: '_obj/opa.wasm' is up to date.
cp wasm/_obj/opa.wasm internal/compiler/wasm/opa/opa.wasm
GO111MODULE=on GOFLAGS=-mod=vendor go generate
GO111MODULE=on GOFLAGS=-mod=vendor go build -o opa_linux_arm64 -ldflags "-X github.com/open-policy-agent/opa/version.Version=0.19.0-dev -X github.com/open-policy-agent/opa/version.Vcs=88d6ca32 -X github.com/open-policy-agent/opa/version.Timestamp=2020-03-29T02:25:25Z -X github.com/open-policy-agent/opa/version.Hostname=Patricks-MacBook-Pro.local"
$ file opa_linux_arm64
opa_linux_arm64: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=j_yyDbC8Pu-fQJ7oq9VH/6aqO2bg5NvfQoXMp8jgo/8bT9gva510YbDWZxDm3j/q9AxXn6FTP1ORmwqT4AC, not stripped

To make the container image for this you'd just need to grab the OPA source and use the golang base image (similar to what OPA does https://github.com/open-policy-agent/opa/blob/master/Makefile#L170) then copy the binary into the base image you want to use (see https://github.com/open-policy-agent/opa/blob/master/Dockerfile for reference, it doesn't need to do a whole lot).

I think there are a few things we'd want to do to add support:

  • Add arm binaries to be part of the "release" Makefile target(s)
  • Add support for publishing multi-arch images
  • Update travis to build/push the arm binaries with the others

I tried deploying opa using helm on a Rancher k3s cluster running on a number of Raspberry Pis.

The deployment fails with an "exec format error" message

opa only supports the amd64 architecture, not the arm/v6 architecture.

would love to have this as we use arm64 ec2 instances

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PriyaKatkade picture PriyaKatkade  路  4Comments

anadon picture anadon  路  9Comments

tsandall picture tsandall  路  6Comments

tsandall picture tsandall  路  7Comments

kadimulam picture kadimulam  路  8Comments