Skip to content
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

Unable to use a custom base image #1220

Open
FNSdev opened this issue Jan 25, 2024 · 6 comments
Open

Unable to use a custom base image #1220

FNSdev opened this issue Jan 25, 2024 · 6 comments

Comments

@FNSdev
Copy link

FNSdev commented Jan 25, 2024

Hello,

I am struggling to understand what causes ko build to fail when using a custom base image.

  • ko version = v0.15.1
  • OS = Linux, Ubuntu

A simple custom base image

FROM alpine:3.19

docker build -t ko.local/custom-base:0.0.3 .

Error when using ko:

-> % ko build --local
2024/01/25 13:47:16 Using base ko.local/custom-base:0.0.3@sha256:c19cfdee9ec320fa294fd9cc7e528648d9aed7f95966bd4a135e387d0892dc64 for dummy-app
2024/01/25 13:47:16 Using build config #0 for dummy-app
2024/01/25 13:47:16 Building dummy-app for linux/amd64
2024/01/25 13:47:16 Loading ko.local/dummy-app-72ccebfa6515bd599e9b93a5feb43507:f482cc01ae5fc0f3eb8df91b6cc2e94e5381531a8c71df53a94e1c15517fbde9
2024/01/25 13:47:16 daemon.Write response:  
Error: failed to publish images: error publishing ko://dummy-app: error loading image: error during connect: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.43/images/load?quiet=0": unable to calculate manifest: blob sha256:f1ce466261fc493d77470b0d63abbed27450e892b9afdf991d2e3738ae9c3d18 not found

.ko.yaml

defaultBaseImage: ko.local/custom-base:0.0.3

I have tested the same example on a personal machine, and can't reproduce it.

Could you please point me to the right direction? Already tried to prune images, containers, etc, as well as restarting docker.

P.S. it works fine if I set defaultBaseImage: alpine:3.19 directly.

@guilhermocc
Copy link

I'm also having this problem using Ubuntu 22.04.3 LTS x86_64 with Ko version 0.14.1

@guilhermocc
Copy link

@FNSdev Apparently, the problem is with docker, as you can see here: docker/buildx#2218

I got it working by downgrading my docker desktop to 4.25.2 which comes with the following plugin versions:

Client: Docker Engine - Community
 Version:    25.0.1
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2-desktop.5
    Path:     /usr/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.0-desktop.1
    Path:     /usr/lib/docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /usr/lib/docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.20
    Path:     /usr/lib/docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.9
    Path:     /usr/lib/docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /usr/lib/docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /usr/lib/docker/cli-plugins/docker-scan
  scout: Docker Scout (Docker Inc.)
    Version:  v1.0.9
    Path:     /usr/lib/docker/cli-plugins/docker-scout

Don't know yet which update introduced the bug.

@aaomidi
Copy link

aaomidi commented Feb 13, 2024

I believe this was solved by moby/moby#47210, testing now.

@aaomidi
Copy link

aaomidi commented Feb 13, 2024

It wasn't :(

@aaomidi
Copy link

aaomidi commented Feb 13, 2024

@FNSdev, try using ko after this version: a271b54

Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants