quay / clair

Vulnerability Static Analysis for Containers

Home Page:https://quay.github.io/clair/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Release “quay.io/projectquay/golang” docker image for Linux/ARM64

odidev opened this issue · comments

Feature Request

Hi Team,

I am working on the distributed mode of running Clair, and successfully submitted the manifest via clairctl on my Linux/AMD64 environment.

To do so, I made use of indexer, matcher and notifier targets mentioned in the docker-compose.yaml file. These targets create containers with image “quay.io/projectquay/golang”, which is not available for the Linux/ARM64.

As an alternative on my Linux/ARM64 environment, I edited this base image to “golang:1.15”, which is available for ARM64 as well. Now, I repeated the same process, and I could run Clair in the distributed mode on Linux/ARM64 machine as well. And for submitting certain images like ‘openshift/origin-cli’ via clairctl, we also need to install ‘rpm’ in the containers while using “golang:1.15” image for ARM64. I have tested the same on Linux/AMD64 machine as well.

Since Clair already supports Linux/ARM64 environment, and ‘clairctl’ binary is also available for ARM64, it will be helpful if “quay.io/projectquay/golang” becomes available for Linux/ARM64 as well. Please let me know if you are interested in the same, or else, can we edit the base image to “golang:1.15” in the source code? I will be happy to contribute, if required.

Environment

Clair version/image: v4.1.1

Clair client name/version: https://github.com/quay/clair/releases/download/v4.1.1/clairctl-linux-amd64

Host OS: Linux (Ubuntu)

Kernel (e.g. uname -a):
Linux x_server_embedded 5.0.0-23-generic README: minor grammar/spelling tweaks #24~18.04.1-Ubuntu SMP Mon Jul 29 16:12:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:53:14Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}

Network/Firewall setup: NA

Hey @odidev , thanks for the suggestion! Glad you got the distributed mode up and running.

As noted in the registry for quay.io/projectquay/golang:

This repository tracks the official docker hub Golang repository. Dependencies necessary to run Clair are added to this container.

This container can be used as a base for Clair containers.

So it's more of a Clair base image rather than a Go base image.

You are correct, quayproject's golang/Clair image is only built to support linux-amd64 currently (https://quay.io/repository/projectquay/golang/manifest/sha256:52486fe8ff4d2973b2950aa154e6676bc83d43871c717298767df10558b3c7ac). IMO we can explore adding more support there (and at least add to the docs that only amd64 is supported), but discarding the image entirely in favor of the standard golang image would probably be a mistake as it serves as an opinionated environment both currently and for any addition dependencies Clair might need in the future.

Thank you @crozzy for your response.

Yes, you are correct. It will be really helpful if quay.io/projectquay/golang is officially released for Linux/ARM64 as well. I am currently working with Clair on the Linux-ARM64 platform, so are you planning on releasing quay.io/projectquay/golang for Arm in the near future?
If required, I am happy to help.

I'd like to see this, also. That go image is built here, so changing that to set up qemu-user-static and docker buildx are probably the next steps. Then, the cut-release action can be updated to similarly run for multiple platforms.

@hdonnay @crozzy

I have raised a PR to release multi-arch Docker image for Quay's Golang in the Claircore repo. Please find it here: quay/claircore#428. Kindly review and suggest any changes if required.