Giter VIP home page Giter VIP logo

Comments (16)

peterbe avatar peterbe commented on May 29, 2024

According to this documentation the GITHUB_TOKEN should have write access to packages.

from docker-build-with-cache-action.

whoan avatar whoan commented on May 29, 2024

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.

whoan avatar whoan commented on May 29, 2024

@peterbe I tested both with my user and with a company's user and it worked with both of them:

from docker-build-with-cache-action.

peterbe avatar peterbe commented on May 29, 2024

Could you please check the permissions under Settings > Actions > Actions permissions ?

Screen Shot 2020-09-08 at 2 05 21 PM

from docker-build-with-cache-action.

peterbe avatar peterbe commented on May 29, 2024

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.

peterbe avatar peterbe commented on May 29, 2024

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.

whoan avatar whoan commented on May 29, 2024

@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.

peterbe avatar peterbe commented on May 29, 2024

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.

peterbe avatar peterbe commented on May 29, 2024

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.

whoan avatar whoan commented on May 29, 2024

@peterbe Could you please elaborate on those consecutive docker-compose builds 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.

peterbe avatar peterbe commented on May 29, 2024

consecutive docker-compose builds you need. You need to use the generated image in further actionn steps?

No, our CI does this:

  1. docker-compose build
  2. docker-compose run something
  3. 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.

whoan avatar whoan commented on May 29, 2024

@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.

whoan avatar whoan commented on May 29, 2024

@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.

peterbe avatar peterbe commented on May 29, 2024

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.

whoan avatar whoan commented on May 29, 2024

@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.

peterbe avatar peterbe commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.