Comments (16)
According to this documentation the GITHUB_TOKEN
should have write access to packages
.
from docker-build-with-cache-action.
Hi @peterbe . I can take a look at this later today. The only thing to mention is that it seems to be a problem with permissions.
I will try to create an organization and try the action there as I think I didn't test such a scenario. Could you please check the permissions under Settings > Actions > Actions permissions ?
from docker-build-with-cache-action.
@peterbe I tested both with my user and with a company's user and it worked with both of them:
- https://github.com/whoan-company/hello-world/runs/1087325476 (action example)
- https://github.com/whoan-company/hello-world/runs/1087342553 (action example)
from docker-build-with-cache-action.
Could you please check the permissions under Settings > Actions > Actions permissions ?
from docker-build-with-cache-action.
Could it be because my PR is from fork peterbe
to master inside the upstream mdn
. I'll try to make a PR within the repo rather than from a user to an org.
from docker-build-with-cache-action.
In my experiment, I was trying to push to the GitHub Container Registry from within a PR (fork:topic-branch to origin:master). Perhaps that just isn't allowed and it's just sad that the error message isn't better.
In reality, what we're hoping to end up is that we'll only push to the registry on commits to master
but all the various PRs from people to the origin/master
will be using read to get caching layers.
from docker-build-with-cache-action.
@peterbe what about this in your workflow:
on:
push:
branches:
- master
pull_request:
branches:
- master
and this in the action:
push_image_and_stages: on:push
from docker-build-with-cache-action.
If that works, I'll take it. Thanks. For now I'm just trying to get the first basic push to work ;)
from docker-build-with-cache-action.
I don't know exactly what I did but now it's kinda working! https://github.com/mdn/kuma/packages/390064
Your action pushed this.
What I now need to figure out is how to actually use it in consecutive docker-compose build
.
from docker-build-with-cache-action.
@peterbe Could you please elaborate on those consecutive docker-compose build
s you need. You need to use the generated image in further actionn steps? If so, notice the action outputs the resulting image name.
from docker-build-with-cache-action.
consecutive
docker-compose build
s you need. You need to use the generated image in further actionn steps?
No, our CI does this:
docker-compose build
docker-compose run something
docker-compose run somethingelse
...for every PR. But the docker-compose build
takes a long time. So we're hoping we can benefit from docker-build-with-cache-action
to get the second docker-compose build
to leverage the docker layer caching.
For example, on my laptop, on a clean docker layer cache, it takes 4m40s to run docker-compose build
but the second time I run it it takes 17s.
But perhaps that's not docker-build-with-cache-action
and images work. (I'm not a docker or docker-compose expert!)
Perhaps it's wrong to bother pushing the built images to any registry and just have the "stages" pushed to the cache without bothering with any registry.
from docker-build-with-cache-action.
@peterbe This action is meant to read a Dockerfile and build one image at a time. Maybe it's time to support reading a compose file. I will give it a try soon.
from docker-build-with-cache-action.
@peterbe It seems that supporting to read from a compose file is a big effort and would make the script way more complex.
On the other hand, you can set a step with this action for each image you need to build (based on your compose file), and you should accomplish same functionality. Closing this as I think reading from a compose file shouldn't be mandatory for that reason.
from docker-build-with-cache-action.
Thanks for your help @whoan !
I've come to appreciate that I still have a lot to learn with Docker stuff.
docker-compose
is just an abstraction (a YAML file) for typing docker
commands plus that thing that is able to start up multiple containers across a range of ports and stuff.
I'm wondering, since docker-compose build
is just a wrapper for docker build
but with the params specified in the docker-compose.yml
, if I use docker-build-with-cache-action
it would use the GitHub Action Cache to make the consecutive docker build
faster.
from docker-build-with-cache-action.
@peterbe I have finally added support to compose files: #78
Feel free to check if it fits your needs.
from docker-build-with-cache-action.
Cheers! I must admit that I lost my momentum with this work. But by the time I get back into it, perhaps your PR will have been merged and release :) Looking forward to it!
from docker-build-with-cache-action.
Related Issues (20)
- [Request] Publish Action image to `ghcr.io` instead of building on-the-fly HOT 2
- docker cache and no cache set as variable HOT 2
- issue with pulling image from aws
- Fail to build rails app that rely on mimemagic HOT 4
- Is it possible to only build specific services from compose? HOT 1
- Support for YAML anchors and aliases? HOT 1
- build stages not being pushed HOT 4
- Could not log in (please check credentials) HOT 1
- When using <folder>/docker-compose.yaml, the context is not relative to <folder>
- compose_file ignored build args HOT 1
- Make the action to work with DOCKER_BUILDKIT enabled HOT 2
- Workaround `DOCKER_BUILDKIT` issue where builds are broken when it's disabled
- v8 always push the image regardless what we set in `push_image_and_stages`
- Add ability to choose "cache image" name HOT 1
- Honour stages_image_name in AWS public ECR when BuildKit is disabled
- Buildx images are not cleaned-up on self-hosted runner HOT 1
- Supplying AWS creds but still getting missing username warning HOT 9
- Support cache mounts using reproducible-containers/buildkit-cache-dance HOT 3
- Slower than docker/build-push-action@v5 in certain situations (using ECR)
- Pushing image stages with tags
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-build-with-cache-action.