Building docker images with jupyter/repo2docker

73 views
Skip to first unread message

Tony Hirst

unread,
Nov 6, 2017, 9:26:19 AM11/6/17
to Project Jupyter
Having realised I can use jupyter/repo2docker rather than killing binderhub (doh! Sorry:-( I was wondering if there is a simple way of just using repo2docker to build and name/tag an image on my machine, rather than building the image and running a container from it?

eg something like jupyter-repo2docker https://github.com/psychemedia/parlihacks --build --name myname/mycontainer 

That way, I can use a repo (and the jupyter build tools) to build and test image locally, then I can push it to dockerhub and call on it directly (prebuilt) from a repo run via binderhub  ?

At,. I guess I can use jupyter/repo2docker to build the image, then just rename the image and push it myself. But that's one step harder for non-devs and sysadmins, and the potential for all this stuff is that it makes things one step easier...

--tony

Tim Head

unread,
Nov 6, 2017, 10:45:44 AM11/6/17
to jup...@googlegroups.com
On Mon, Nov 6, 2017 at 3:26 PM Tony Hirst <tony....@gmail.com> wrote:
Having realised I can use jupyter/repo2docker rather than killing binderhub (doh! Sorry:-( I was wondering if there is a simple way of just using repo2docker to build and name/tag an image on my machine, rather than building the image and running a container from it?

This should do that for you:

jupyter-repo2docker https://github.com/jakevdp/PythonDataScienceHandbook --image-name pydatabook --no-run

T

Tim Head

unread,
Nov 6, 2017, 10:55:24 AM11/6/17
to jup...@googlegroups.com
Though I just stepped into the same argparse trap as earlier. All arguments have to come before the URL:

jupyter-repo2docker --image-name pydatabook --no-run https://github.com/jakevdp/PythonDataScienceHandbook

(If there is a argparse wizard present, we'd appreciate a fix that allows you to do what I posted in the previous email)

T

Tony Hirst

unread,
Nov 6, 2017, 12:51:21 PM11/6/17
to Project Jupyter
great - thanks

Tony Hirst

unread,
Nov 10, 2017, 5:40:55 AM11/10/17
to Project Jupyter
One more thing.... 

Is there a way to build from a branch rather than master? eg I don't see a --branch option?


On Monday, 6 November 2017 15:55:24 UTC, Tim Head wrote:

Tim Head

unread,
Nov 10, 2017, 5:42:52 AM11/10/17
to jup...@googlegroups.com
On Fri, Nov 10, 2017 at 11:40 AM Tony Hirst <tony....@gmail.com> wrote:
One more thing.... 

Is there a way to build from a branch rather than master? eg I don't see a --branch option?


Jupp, --ref should understand revisions, tags, and branch names etc

T

Tony Hirst

unread,
Nov 10, 2017, 7:19:35 AM11/10/17
to Project Jupyter
Hmm... I'd tried with --ref BRANCH but that just gave a fatal error:


jupyter-repo2docker https://github.com/USER/REPO --ref BRANCH


gives:

unknown revision or path not in the working tree

Tim Head

unread,
Nov 10, 2017, 9:18:24 AM11/10/17
to jup...@googlegroups.com
On Fri, Nov 10, 2017 at 1:19 PM Tony Hirst <tony....@gmail.com> wrote:
Hmm... I'd tried with --ref BRANCH but that just gave a fatal error:


jupyter-repo2docker https://github.com/USER/REPO --ref BRANCH


gives:

unknown revision or path not in the working tree



Indeed, also fails for me. I think that is a bug: https://github.com/jupyter/repo2docker/issues/135

As a workaround (actually tried it before recommending it ...) you can put the SHA of the commit on the branch.

T
Reply all
Reply to author
Forward
0 new messages