question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot use base image hosted on ghcr

See original GitHub issue

Environment:

  • Jib version: 2.6.0
  • Build tool: Gradle
  • OS: Linux

Description of the issue: When using Jib to build an image with a base image hosted on GitHub Container Registry (ghcr.io), it fails with Premature end of Content-Length delimited message body

Expected behavior:

Build should succeed with ghcr.io base image

Steps to reproduce:

  1. git clone https://github.com/anuraaga/jib-ghcr.git
  2. cd jib-ghcr
  3. ./gradlew jibDockerBuild

jib-gradle-plugin Configuration:

jib {
  to {
    image = "ghcr.io/anuraaga/foobar"
  }
  from {
    image = "ghcr.io/github/super-linter:v3"
  }
  container {
    mainClass = "Application"
  }
}

I have tried with other ghcr images (I originally tried with my own image and switched to github’s example super-linter)

Log output:

Base image 'ghcr.io/github/super-linter:v3' does not use a specific image digest - build may not be reproducible
The base image requires auth. Trying again for ghcr.io/github/super-linter:v3...
Using credentials from Docker config (/Users/aanuraag/.docker/config.json) for ghcr.io/github/super-linter:v3
Using base image with digest: sha256:b5b43c0f80224919968b1482b48d82c2424cf596e09468917025575a6bf110d2
I/O error for image [ghcr.io/github/super-linter]:
    org.apache.http.ConnectionClosedException
    Premature end of Content-Length delimited message body (expected: 31,167; received: 0)

Additional Information:

The base image works fine with docker pull or building a Dockerfile. Jib works fine with images hosted on other container registries. ghcr base images used to work, but stopped working last week or so, presumably due to a change in ghcr. However, since the docker command works fine, presumably it’s something that can be fixed in jib too. Perhaps it’s time to swap apache HTTP with okhttp.

Also just to make sure it’s not an auth related issue I tried with removing .docker/config.json and same error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
clarkbwcommented, Oct 20, 2020

👋 we rolled out a fix for this header about 2 hours ago, you should see it working now. Thanks! 🙇

1reaction
anuraagacommented, Oct 21, 2020

@clarkbw Thanks for the quick fix! Confirmed it’s working fine now 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Docker image from Github registry is unauthorized
Now I want to use it in Github action that create Docker image in FROM field but it always fails with unauthorized error...
Read more >
Example workflows - Docker Documentation
Example workflows. This page showcases different examples of how you can customize and use the Docker GitHub Actions in your CI pipelines.
Read more >
Migrating my Docker images to the GitHub Container Registry
As you can see, I am using my own base image which is hosted at ghcr.io/russmckendrick/base:latest , I am also using the OpenContainer ......
Read more >
GitHub Container Registry - Robs blog
I wanted to use the GitHub Container Registry to host an image for ... the Docker image run: docker build -t ghcr.io/«ACCOUNT NAME»/«IMAGE...
Read more >
Unable to pull images from ghcr.io - Home Assistant Community
However, if I try to run this in the shell, I get the same 500 error as before. The host has unfettered access...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found