Repo2docker-action: MyBinder still builds the image, rather than pulling it

Created on 29 Mar 2021  ·  13Comments  ·  Source: jupyterhub/repo2docker-action

Hello, thanks for this really nice action!
Not sure whether this is a bug with the action or a bug with my usage of it.
I've used successfully the action in the past, but I am currently unable to make it work properly with this repo: The workflow including the action goes through and the image is uploaded and publicly visible: Nevertheless, will always rebuild it from scratch, so there must be something wrong in my set up.


All 13 comments

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:

Welcome to the Jupyter community! :tada:

I know that Binder uses repo2docker, which will scan your repository for configuration files that have the following build priority

Just taking a quick look at your repo, it seems like you have other build files in there that will signal to Binder to build, rather than use your image. I'm not sure off hand if there is a way to tell Binder that you want to build off the Dockerfile as the first priority. @choldgraf do you have any ideas for this?

Oh my apologies had a slight misunderstanding.

Looks like you are trying to force MyBinder to build an image to force it cache the image. Please keep in mind that if your repo has any additional commits the cache is invalidated. Also, this is subject to MyBinder caching capacity and rules, which could change over time.

This should not be related at all to your image being publicly visible per my understanding. I tagged a friend that have more insight into this.

If you try just using twice in a row to start a notebook (not relying on this Action) does it build each time?

Yep - binder will rebuild the image based on the commit hash, so if you're changing the repo at all, a new build will trigger even if you're not changing a configuration file

I see. I am re-running this action on every commit though. So if I wait for the Docker image to be uploaded before launching binder, shouldn't I see an almost instant startup?

hmmm - so the repo2docker action just builds an image and pushes it to a repository, it doesn't do anything with Binder specifically. You'd need to configure a Binder repository that _pulls_ from wherever repo2docker-action is pushing, and leave that static so that Binder doesn't re-build it each time.

Just to check whether I understand your last comment correctly:

  1. I can have a separate branch/repo with environment.yml and the action pushing to a package repository.
  2. The main branch has a binder/Dockerfile whose only content is the line FROM repo/package:latest.

@choldgraf @robertodr no actually this Action does have the ability to cache builds directly to however, if the action ends up creating commit for you then that cache will be invalidated immediately.

I see that you were using the wrong flag previously and you were supposed to use MYBINDERORG_CACHE

Does it work now?

Is it MYBINDERORG_CACHE or BINDER_CACHE together with MYBINDERORG_TAG? It looks like it's working now, but it's most likely because I've started the notebooks a couple of times in short succession :facepalm:

@robertodr I would go with this example from the README, sorry meant TAG not CACHE


@hamelsmu wow this action is cooler than I remembered 😄

Wow, yes, I feel quite silly now... I think I tried to get it to push the image to GHCR and expected it to use in on automagically. Then tried to fix that and got the option names mixed up :facepalm:

As an aside, the attempt with BINDER_CACHE did work too. However, the specific repo I am working with uses LFS to store the notebooks and they would not be checked out properly.

ok great! I'll close this issue then. This was also a good refresher for me as I haven't looked at this repo in some time.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abh1nav picture abh1nav  ·  19Comments

notnoop picture notnoop  ·  23Comments

datag picture datag  ·  9Comments

dfang picture dfang  ·  4Comments

parkerlreed picture parkerlreed  ·  15Comments