rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.84k stars 272 forks source link

Update containerd/nerdctl to v1.7.4 to support `nerdctl build` args: `--attest`,` --sbom`,`--provenance` #6604

Closed pulberg closed 6 months ago

pulberg commented 6 months ago

Problem Description

I need to use these args as part of my build process, these are now available in v1.7.4 -

nerdctl build args: --attest,--sbom,--provenance

Proposed Solution

Update embedded containerd/nerdctl to v1.7.4

Additional Information

No response

jandubois commented 6 months ago

I need to use these args as part of my build process, these are now available in v1.7.4 -

nerdctl build args: --attest,--sbom,--provenance

We just shipped Rancher Desktop 1.13.0 which includes nerdctl 1.7.3, so we won't be able to upgrade nerdctl again until the 1.14.0 release to whatever is the current version at that time.

However, it isn't clear from the nerdctl 1.7.4 release notes that it includes any changes relevant to these build args (compared to the 1.7.3 release).

You can upgrade nerdctl yourself with this rd-update-nerdctl script:

#!/bin/bash

set -eux

VERSION=${VERSION:-1.7.4}
ARCH=$(uname -m)
ARCH=${ARCH/x86_64/amd64}

BASEURL=https://github.com/containerd/nerdctl/releases/download
rdctl shell sudo -i wget "${BASEURL}/v${VERSION}/nerdctl-${VERSION}-linux-${ARCH}.tar.gz"
rdctl shell sudo -i tar xvfz "nerdctl-${VERSION}-linux-${ARCH}.tar.gz" -C /usr/local/libexec/nerdctl nerdctl
rdctl shell sudo -i rm "nerdctl-${VERSION}-linux-${ARCH}.tar.gz"

It defaults to upgrading to 1.7.4:

$ nerdctl --version
nerdctl version 1.7.3

$ ./rd-update-nerdctl
+ VERSION=1.7.4
…

$ nerdctl --version
nerdctl version 1.7.4

You can also use it to downgrade again:

$ VERSION=1.7.3 ./rd-update-nerdctl
+ VERSION=1.7.3
…

$ nerdctl --version
nerdctl version 1.7.3