#1523  How to configure Docker BuildKit (buildx plugin) for Agents?
Closed
narandill opened 8 months ago

Hi, I would like to say that I love current CI/CD features here 👏, but I'm wonder if I'm doing the right things to make the BuildKit work on my Agents. Whenever I launch pipeline Ive got this message:

12:06:56 Running step "Build Docker Image"...
**12:06:56 DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
12:06:56             Install the buildx component to build images with BuildKit:
12:06:56             https://docs.docker.com/go/buildx/**
12:06:56 
12:06:56 Sending build context to Docker daemon  162.3kB

The Agent is working under Docker Engine:

narandill@ubuntu:~$ docker version
Client: Docker Engine - Community
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.6
 Git commit:        ced0996
 Built:             Fri Jul 21 20:35:47 2023
 OS/Arch:           linux/arm64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.6
  Git commit:       a61e2b4
  Built:            Fri Jul 21 20:35:47 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 nvidia:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Together with installed plugins:

narandill@ubuntu:~$ docker compose version
Docker Compose version v2.20.2
narandill@ubuntu:~$ docker buildx version
github.com/docker/buildx v0.11.2 9872040

I altered the Docker Deamon JSON config to enable buildx as follows:

{
    "default-runtime": "nvidia",
    "runtimes": {
        "nvidia": {
            "args": [],
            "path": "/usr/bin/nvidia-container-runtime"
        }
    },
    "features": {
        "buildkit": true
    }
}

Is there anything else which I need to do to make the BuildKit working with my Agents?

Robin Shen commented 8 months ago

@narandill make sure you have buildx installed on the agent. By default it is not shipped with docker.

Robin Shen changed state to 'Closed' 8 months ago
Previous Value Current Value
Open
Closed
narandill commented 8 months ago

@robin I have installed buildx:

narandill@ubuntu:~$ docker buildx version
github.com/docker/buildx v0.11.2 9872040
Robin Shen commented 8 months ago

You may run as the same OS user running agent process, and test why docker build shows this legacy warning.

jbauer commented 7 months ago

@narandill I had the same issue and on the host running the docker daemon everything looked fine. However the real issue is inside the image/container that is used to run the job steps. I use my own image based on ubuntu and installed docker cli using apt install --no-install-recommends -y -qq docker-ce-cli. However the buildx and compose plugins are recommend packages for docker-ce-cli and thus have not been installed. So I had to install docker-buildx-plugin to get buildx and docker-compose-plugin to get compose support inside the running job container.

issue 1 of 1
Type
Question
Priority
Major
Assignee
Labels
No labels
Issue Votes (1)
Watchers (4)
Reference
onedev/server#1523
Please wait...
Page is in error, reload to recover