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

trying to use onbuild with binder, error "unknown flag: chown" #36

Open
rabernat opened this issue Apr 29, 2019 · 6 comments
Open

trying to use onbuild with binder, error "unknown flag: chown" #36

rabernat opened this issue Apr 29, 2019 · 6 comments

Comments

@rabernat
Copy link
Member

I'm trying out the new onbuild stuff in this repo:
https://github.com/rabernat/local_stencil_ml_examples

My Dockerfile looks like this

FROM pangeo/pangeo-notebook-onbuild:2019.04.19

# https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html#preparing-your-dockerfile
ENV NB_USER jovyan
ENV NB_UID 1000
ENV HOME /home/${NB_USER}

COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}

I got this error.

Waiting for build to start...
/usr/local/lib/python3.7/site-packages/repo2docker/utils.py:214: FutureWarning: Possible nested set at position 1815
  """, re.VERBOSE)
Picked Git content provider.
Cloning into '/tmp/repo2docker_8lb8bku'...
HEAD is now at fce01c6 first commit
Using DockerBuildPack builder
Step 1/8 : FROM pangeo/pangeo-notebook-onbuild:2019.04.19
# Executing 5 build triggers...
Step 1/1 : COPY --chown=1000:1000 . ${REPO_DIR}
Unknown flag: chown

I'm going to try removing all the extra docker stuff.

@rabernat
Copy link
Member Author

After updating the Dockerfile, I am still getting the same error

Waiting for build to start...
/usr/local/lib/python3.7/site-packages/repo2docker/utils.py:214: FutureWarning: Possible nested set at position 1815
  """, re.VERBOSE)
Picked Git content provider.
Cloning into '/tmp/repo2dockerlo7vr772'...
HEAD is now at 2ce06d5 removed crap from Dockerfile
Using DockerBuildPack builder
Step 1/1 : FROM pangeo/pangeo-notebook-onbuild:2019.04.19
# Executing 5 build triggers...
Step 1/1 : COPY --chown=1000:1000 . ${REPO_DIR}
Unknown flag: chown

@rabernat
Copy link
Member Author

@yuvipanda
Copy link
Member

I think you need a newer version of docker - —chown was added a few years ago. We can also make the onbuild variants not use it if we wanna support older versions of docker. If this is on Pangeo binder I think it should be fixed by the dind work @jhamman is doing. Can you try on mybinder.org to see if it works there?

Also you only need the FROM line and nothing more when using the onbuild variants.

@yuvipanda
Copy link
Member

#37 removes --chown so the onbuild variants will be compatible with older docker versions.

@yuvipanda
Copy link
Member

I think rabernat/local_stencil_ml_examples#1 fixes it. It works on mybinder.org with this - https://mybinder.org/v2/gh/yuvipanda/local_stencil_ml_examples/master. Once #37 lands and we use that as base image, it should work on pangeo binder too.

@jhamman
Copy link
Member

jhamman commented May 1, 2019

@rabernat - I've updated the docker version on pangeo-binder so your original onbuild example should work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants