rancher-desktop icon indicating copy to clipboard operation
rancher-desktop copied to clipboard

DOCKER_BUILDKIT Defaults To 0

Open Fenikkusu opened this issue 3 years ago • 2 comments

Rancher Desktop Version

1.0.1

Rancher Desktop K8s Version

1.21.9

Which container runtime are you using?

moby (docker cli)

What operating system are you using?

macOS

Operating System / Build Version

macOS Big Sure - OSX 11.4

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

No response

Actual Behavior

When Running docker build commands, DOCKER_BUILDKIT is either not defined or set to 0. Any Images using the Docker BuildKit Advanced Features (Like Cache Directories), will fail to build because it is using the legacy build mechanism. You have manually set DOCKER_BUILDKIT=1 in order to enable it.

Steps to Reproduce

Just run docker build vs DOCKER_BUILDKIT=1 docker build

Result

//...
RUN --mount=type=cache,target=/var/composer \
    ./ci/scripts/zephir-build.sh
//...

Step 24/25 : RUN --mount=type=cache,target=/var/composer ./ci/scripts/zephir-build.sh && cp -r /app /opt/tf_shared 1 error occurred: * Status: the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled, Code: 1

Expected Behavior

Successful Build

Additional Information

This may just be an issue with the version of dockerd included, but I haven't researched it any more. I'm just exporting the var.

Fenikkusu avatar Feb 08 '22 15:02 Fenikkusu

From https://docs.docker.com/develop/develop-images/build_enhancements/, you need to set DOCKER_BUILDKIT=1 to enable it. I assume you're trying to run a build within the UI, because on the command line it's straightforward to set that environment variable. Sounds like a reasonable change to the Rancher Desktop UI.

ericpromislow avatar Feb 08 '22 18:02 ericpromislow

I'm running it in the terminal, and yes, doing DOCKER_BUILDKIT=1 docker build or export DOCKER_BUILDKIT=1 works fine. I just know that recent installs of Docker Desktop default it on now, and have been for a while if I recall correctly.

Fenikkusu avatar Feb 08 '22 20:02 Fenikkusu

This affects also docker-compose (see #6365).

jandubois avatar Jan 29 '24 18:01 jandubois

There is nothing left to do here; buildkit is the default in moby 23.* now.

jandubois avatar Feb 01 '24 19:02 jandubois