-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build from local image with buildctl (OCI Worker) #1142
Comments
Buildkit with oci worker does not provide an image store. This has been discussed in the past but would mean we would need to add image management commands in the API. You can use containerd worker with the containerd image store(managed with ctr) or docker/buildx with docker image store. |
@tonistiigi thanks for the answer, but coming just from the "docker world" i don't know exactly how to use containerd from buildkit in practice, especially the fetching part. In this example i have a Dockerfile depending on a first one built only locally. Let's assume it is stored with containerd. But then it's still buildkit that needs to load it, so how would it find it in that local store? Do you need to name the local image in a particular way? |
The first build would export it with a name |
I tried this but the second build still fails for the same reason. I don't still understand how the loaders work and how buildkit is going to find such image. I'm using the dockerized version of buildkit:
The first build produces an image that i can "somehow" see with |
|
Is there any simple tutorial or documentation for setting up such a configuration? I have never used containerd and it sounds quite obscure to an end-user not familiar with terms like rund, containerd, workers or OCI, this all sounds like internal stuff for container developers which i'm not. The nice thing with Docker is its convenience and accessibility, it can be used out of the box from a simple apt installation. Here i don't even know where to look. |
I face the same problem, and tried to switch from oci to containerd worker but fails to boot the buildkit deamon.
The image tag for moby/buildkit is 8ce8d3df040f. I am running on Mac Docker desktop (2.1.03) with Engine version 19.03.2 Is that I must build the |
I'm experiencing the same issue. Looking into the @tonistiigi since you suggested to start I'm also freshly started with docker, but from the official documentation |
As I wrote in #1142 (comment)
buildx doesn't have anything to do with the question in here that is about buildctl. in buildx results are automatically get/put to |
Ok, I think I'm getting even more confused, maybe I'll describe my use case more in detail to explain how I ended up here.
If I try the same using the default builder under |
@gfrancesco If you want buildx to access |
Thanks for helping, I'll keep an eye on the PR and look into use a registry in the meantime 🙂 |
moby/moby#39144 has been merged in yet it looks like I got the same problem on circleci: The dockerfile is a multi-stage dockerfile. partial docker build script: export DOCKER_BUILDKIT=1
###############################################
BACKEND_TAG=${CIRCLE_BRANCH}-backend-v2
echo "Pull old image for layer caching"
# Return true to ensure branches without images can still build
docker pull ${AWS_ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/15five/fifteen5:${BACKEND_TAG} || true
echo "Build new python backend docker image"
docker build -f Dockerfile.production --target python_backend \
--tag 15five/fifteen5:${BACKEND_TAG} \
--build-arg dynatrace_subdomain=${DT_ENDPOINT} \
--build-arg use_dynatrace=1 \
. - setup_remote_docker:
version: 19.03.12 Output of the above is:
docker build script log:
Note that base image on circleci worked fine with buildkit enabled, so buildkit can work with circleci - it's just fails in the situation above for some reason 🤔 |
@tonistiigi I'm trying to build image from local image with containerd image store and it works fine if the local image was builded by buildkit. But it fails if the local image was not builded by builtkit (for example: pulled and retagged or imported). It fails with: I suppose this happens because those images are not in local build cache. Is there a way to make it work somehow? |
I'm sorry I don't understand all this but just curious if this is the same root issue as I'm seeing in: |
Description
Cannot build from a local image with
buildctl
which always tries to resolve todocker.io
. This applies to a multi-stage setup or simply from a local image in a CI setup. The base image should not be expected to be pushed to any repository (eitherdocker.io
or even private). It is only available locally (docker images
).This works with
docker build
and evenDOCKER_BUILDKIT=1
using image names (but not SHA ID in the last case). See also moby/moby#39769.This looks similar to the problems with local cache described here: moby/moby#39003.
Steps to reproduce the issue:
./buildctl-build.sh
from bashFROM docker.io/library/bk1:latest
Describe the results you received:
Describe the results you expected:
This should work as for
docker build
when using image names (with or withoutDOCKER_BUILDKIT=1
. Note with SHA-ID it does not work either in the last case as described in moby/moby#39769).Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Connected to a private repository on a different host but this should not have effect here since it works with standard
docker build
.The text was updated successfully, but these errors were encountered: