Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide -onbuild variants of all images #27

Merged
merged 4 commits into from Apr 17, 2019

Conversation

Projects
None yet
2 participants
@yuvipanda
Copy link
Collaborator

commented Apr 13, 2019

This lets people use our images as a base, but
customize it easily with a subset of the files
understood by repo2docker. Currently, this includes:

  • environment.yml
  • requirements.txt
  • postBuild
  • apt.txt

We can add more if necessary.

The contents of the user's repository are also copied
into ${HOME}, merging with (and overwriting) anything
that's in our base images.

To use the onbuild images as a base,

  1. In your git repository, create a file named 'Dockerfile'

  2. Write the name of the base image you would like to use
    in the following format:

    'FROM :'

    For example, you can write:

    'FROM pangeo/base-notebook-onbuild:2019.04.15'

    Note the -onbuild - that is very important.

  3. Create a 'environment.yml', 'requirements.txt' or
    'postBuild' file in your repository (or under a
    'binder/' directory) to customize your environment
    when launched in a binder.

That's it! When this repository is launched in any
binder, your customizations will be applied on top
of the base image you have chosen, and launched.

Fixes #26

@yuvipanda yuvipanda force-pushed the yuvipanda:onbuild branch from 63c931d to 99faac1 Apr 13, 2019

@yuvipanda

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 13, 2019

I'm gonna wait on #28 to land before I continue working on this.

@yuvipanda yuvipanda force-pushed the yuvipanda:onbuild branch 2 times, most recently from d02e39f to 72194a5 Apr 15, 2019

@yuvipanda yuvipanda changed the title [WIP] Onbuild variants of the images Provide -onbuild variants of all images Apr 15, 2019

@yuvipanda yuvipanda force-pushed the yuvipanda:onbuild branch from 72194a5 to b61af24 Apr 15, 2019

@yuvipanda

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 15, 2019

Provide -onbuild variants of all images
This lets people use our images as a base, but
customize it easily with a subset of the files
understood by repo2docker. Currently, this includes:

- environment.yml
- requirements.txt
- postBuild

We can add more if necessary.

The contents of the user's repository are also copied
into ${HOME}, merging with (and overwriting) anything
that's in our base images.

To use the onbuild images as a base,

1. In your git repository, create a file named 'Dockerfile'
2. Write the name of the base image you would like to use
   in the following format:

   'FROM <base-image>:<tag>'

   For example, you can write:

   'FROM pangeo/base-notebook-onbuild:2019.04.15'

   Note the -onbuild - that is very important.
3. Create a 'environment.yml', 'requirements.txt' or
   'postBuild' file in your repository (or under a
   'binder/' directory) to customize your environment
   when launched in a binder.

That's it! When this repository is launched in any
binder, your customizations will be applied on top
of the base image you have chosen, and launched.

Fixes #26

yuvipanda added some commits Apr 15, 2019

Use docker build args to specify base image
Much cleaner than string substitution in Dockerfile
Don't add too many slashes to postBuild Path
postBuild's path is already fully qualified, so the ./
makes it too many /s

@yuvipanda yuvipanda force-pushed the yuvipanda:onbuild branch from eb2054c to 12a98b1 Apr 16, 2019

@jhamman
Copy link
Member

left a comment

Thanks @yuvipanda - this looks great. I think we should basically move forward as is (pending one question below).

I do have the general feeling that it would be nice for r2d_overlay to use more pieces from repo2docker. Obviously, we're just prototyping right now but the pattern seems ripe for some maintenance headaches down the road. For example, apply_environment() is doing a similar, but not exactly identical, thing to r2d. Just something to keep an eye on.

Show resolved Hide resolved onbuild/r2d_overlay.py
@jhamman

This comment has been minimized.

Copy link
Member

commented Apr 17, 2019

@yuvipanda - unless you were hoping for another review, I'd be fine with merging this now so we can start testing it out.

@yuvipanda

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 17, 2019

@jhamman yes please :) A review of #32 would also be great - I think testing should involve both the PRs

@jhamman jhamman merged commit 91e7357 into pangeo-data:master Apr 17, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.