Operator-sdk: arm64 base image doesn't actually work on arm64

Created on 14 Jun 2020  路  7Comments  路  Source: operator-framework/operator-sdk

Bug Report

What did you do?

Installed aarch64 release of operator-sdk, created a skeleton ansible operator, and ran operator-sdk build to generate an image.

What did you expect to see?

The image should run.

What did you see instead? Under which circumstances?

exec format error

Environment

  • operator-sdk version:

v0.18.1

Additional context

It looks like the quay.io/operator-framework/ansible-operator:v0.18.1 base image for ARM64 doesn't have a working tini binary. The file at /tini just contains the text Not found. When I try to run the base image directly on my Raspberry Pi 4 under Ubuntu 20.04, I get exec format error. If I override the entrypoint to run /usr/local/bin/entrypoint directly, it actually runs.

kinbug languagansible lifecyclactive

Most helpful comment

Woohoo, this would be awesome, as with Pi OS 64-bit beta (or Ubuntu 64-bit for ARM, or other ARM64 distros) I can start running my operators on my ARM clusters :)

All 7 comments

It looks like an additional mapping is needed here:

https://github.com/operator-framework/operator-sdk/blob/da47632d2c50e1d2ef4a076f475accd6fd17d224/internal/scaffold/ansible/dockerfilehybrid.go#L91

The arch command returns aarch64 on ARM64, but the tini arch name is arm64.

As a test, I added the following to the generated build/Dockerfile for my test operator, and the resulting image worked.

USER root

RUN TINIARCH=$(case $(arch) in x86_64) echo -n amd64 ;; ppc64le) echo -n ppc64el ;; aarch64) echo -n arm64 ;; *) echo -n $(arch) ;; esac) \
  && curl -L -o /tini https://github.com/krallin/tini/releases/latest/download/tini-$TINIARCH \
  && chmod +x /tini

USER ansible-operator

/kind bug

/lifecycle active

I created PR #3234 to address this

Woohoo, this would be awesome, as with Pi OS 64-bit beta (or Ubuntu 64-bit for ARM, or other ARM64 distros) I can start running my operators on my ARM clusters :)

I've verified that this is fixed in v0.18.2

Was this page helpful?
0 / 5 - 0 ratings