I would like to use ghcr as cache to store docker image with part which almost do not change in my project (Ubuntu, miniconda and bunch of Python packages) and then use this image in Dockerfile which adds volumes and code of the project to it. Dockerfile is run by Github Actions. How could I reference to ghcr stored image in From statement of Dockerfile?
Use ghcr in Dockerfile in GHA
2.4k views Asked by Piotr At
2
There are 2 answers
2
stevec
On
@BMitch's solution worked for me for one public package but not another. Weird..
When I ran docker build I got this:
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unknown desc = failed to fetch anonymous token: unexpected status: 403 Forbidden
A common cause of this error is a typo in the name of the dockerfile.
But I had no typo.
Running this once solved it:
docker pull <ghcr.io/path/to/image:tag>
Note:
- It may or may not have been related, but there was a some sort of bug in GitHub tokens, so I ran this to logout of GHCR with docker.
Related Questions in DOCKER
- sqlplus myusername/mypassword@ORCL not working with Oracle on Docker
- Golang == Error: OCI runtime create failed: unable to start container process: exec: "./bin": stat ./bin: no such file or directory: unknown
- Only the first SQL script gets executed inside Docker Postgres container
- Retrieve the Dockerfile configuration from the Kubernetes and also change container Java parameter?
- Polars with Rust: Out of Memory Error when Processing Large Dataset in Docker Using Streaming
- Compiling eBPF program in Docker fails due to missing '__u64' type
- AttributeError: module 'numba' has no attribute 'generated_jit'
- Phoenix in a docker dev environment - generated code can't be saved from VSCode
- Docker on Multipass VMs: Connecting worker nodes to swarm results in rcp error
- Facing error in creating image of my react+vite project . Dockerfile error
- NextJS Docker build fails: fetch failed ECONNREFUSED
- Docker container unable to make HTTPS requests to external API
- Failed to connect to your instance after deploying mern app on aws ec2 instance when i try to access frontend
- Connecting to Postgres running in a Docker container using psql
- Can't connect to local postgresql server from my docker container
Related Questions in CACHING
- Using Puppeteer to scrape a public API only when the data changes
- Caching private wordpress rest endpoints
- Cloudflare not respecting Cache-Control
- Unexpected Recursive Call
- Cannot serialize (Spring Boot)
- Nginx only caches file endpoints
- The Selenium application properties folder holds two environment options. After running a test the environment setting changes to a previous setting
- Launch jobs in cache in a loop in bash script
- Multiple async request do not store anything to cache
- Dev tool for Next.js cache on the client?
- Creating a letter in the terminal by entering
- Laravel: check if cache has key with thag
- The retrieval time for the Apache Ignite cache is too long
- How to run gradle with caches files
- Docker Run cache mount does not cache apt-get dependencies
Related Questions in DOCKERFILE
- Phoenix in a docker dev environment - generated code can't be saved from VSCode
- Facing error in creating image of my react+vite project . Dockerfile error
- Run multiple shell scripts in Dockerfile
- Error while creating docker image from env.yml file which has a python package that i created locally
- Docker build fails with "failed to solve: the Dockerfile cannot be empty" error
- How do I locally specify the path for nuget in my dockerfile?
- When I use built-in DockerFile in Visual Studio, I see no errors, but when I try to create image and container using terminal I get an error
- is there a way to find the path for mongo database that I have created
- split huge docker-compose file contains fragment into multiiple
- getting osd output from tesseract on (need the script value Latin, cyrillic...) tika-server
- Dockerfile and package-json are in different folders
- Install OpenDevin with Docker
- Installing dotnet8 on amazonlinux 2023 image through dockerfile
- Not being able to run my Jupyter notebook using Dockerfile
- How to add a Maven project to an Ubuntu image in Docker
Related Questions in GITHUB-ACTIONS
- How do I create a test passing badge for my yaml below
- Driver com.microsoft.sqlserver.jdbc.SQLServerDriver claims to not accept jdbcUrl, ${SPRING_DATASOURCE_URL}: GitHub Actions
- Trying to update the version.go file with the release tag from GitHub actions but its failing
- While Running Github Actions Pipeline: No Signing Certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID
- Gradle SAXParseException cvc-complex-type.2.4.a
- Unable to deploy to GAE from Github Actions
- Set environment variable during push for GitHub Actions
- Error: P1001: Can't reach database server at `db`:`5432` on github actions
- Android SafeArgs gives error with GitHub actions
- How to restore nuget from private github feed using Github App and no PAT?
- Github Actions/variable-mapper : Error: Unexpected token *** in JSON
- Github action Post Run fails workflow
- How to push multiple changes from matrix in Github Actions
- Display coverage report on browser
- Unable to use env variable from prd environment context
Related Questions in GHCR
- GitHub Dependabot Doesn't Have Permissions To Publish to GHCR How Can I Give It Access
- How to copy images from GHCR to ACR
- How do I pull a Github (ghcr.io) from Minikube?
- Why GitHub action fails to push the docker image?
- Preconfigure Container Registry in Codespaces
- Should I use a Personal Access Token for accessing ghcr from GitHub Actions?
- ERROR: denied: installation not allowed to Create organization package
- Pulling images from Github container registry is too slow in the last layer
- Error response from daemon: Get https://ghcr.io/v2/: read tcp 10.10.5.108:33012->20.207.73.86:443: read: connection reset by peer
- Does docker pull and push to new registry work?
- getting unsupported media type error by running docker pull from ghcr.io ( image made automaticly by github action )
- Use ghcr in Dockerfile in GHA
- Error response from daemon: Get "https://ghcr.io/v2/": denied: denied
- Not all Docker Images are showing on GitHub container registry
- Cannot pull from GitHub Packages from GitHub Actions
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Image references have the registry in front of them, and when not included, will default to Docker Hub. So for a registry like ghcr you want: