Docker-stacks: Windows compatibility: Permissions?

Created on 7 Jan 2016  路  11Comments  路  Source: jupyter/docker-stacks

OS Windows 7
Docker Toolbox 1.9.1g (docker-machine et al.) with VirtualBox 5.0.10 driver

I am building the jupyter/minimal-notebook Docker image locally. Output looks good up until the very end of the build process:

...
Step 28 : RUN chown -R $NB_USER:users /home/$NB_USER/.jupyter
 ---> Running in d36a6be5f71d
 ---> 7af5afcd23c6
Removing intermediate container d36a6be5f71d
Step 29 : USER jovyan
 ---> Running in 950bc4aa54a9
 ---> bf20cc3e2aca
Removing intermediate container 950bc4aa54a9
Successfully built bf20cc3e2aca
SECURITY WARNING: You are building a Docker image from Windows against a
non-Windows Docker host. All files and directories added to build context will
have '-rwxr-xr-x' permissions. It is recommended to double check and reset
permissions for sensitive files and directories.

When I start a container using this image according to the docs, the container is unable to run. The logs show:

[FATAL] Executing child process 'start-notebook.sh' failed: 'No such file or directory'

When I use the prebuilt image jupyter/minimal-notebook from Docker Hub, the container starts alright and is functional.

Does anyone have experience with building on Windows? Does the security warning have anything to do with this?

Question

Most helpful comment

@aaronsutton hi, I ran into similar issue on Win7 and found the solution here: http://willi.am/blog/2016/08/11/docker-for-windows-dealing-with-windows-line-endings/
In short, try cloning this project with Unix line endings:
git clone https://github.com/jupyter/docker-stacks.git --config core.autocrlf=input

All 11 comments

The warning suggests all files added to the image are made executable so the fact that it can't find start-notebook.sh indicates to me that it isn't because that file is not executable. But let's check. What do you get if you do:

docker run -it --rm the_image_you_built ls -l /usr/local/bin
D:\opt\pyomo-docker>docker run -it --rm pyomo ls -l /usr/local/bin
total 20
-rwxr-xr-x 1 root root   413 Jan  6 15:08 start-notebook.sh
-rwxr-xr-x 1 root root 14584 Sep  6 13:53 tini

Definitely executable. How about:

parente@aether ~ $ docker run -it --rm jupyter/minimal-notebook which start-notebook.sh
/usr/local/bin/start-notebook.sh

parente@aether ~ $ docker run -it --rm jupyter/minimal-notebook env
PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=e408e8cdc449
TERM=xterm
DEBIAN_FRONTEND=noninteractive
CONDA_DIR=/opt/conda
SHELL=/bin/bash
NB_USER=jovyan
NB_UID=1000
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
HOME=/home/jovyan
D:\opt\docker-stacks\minimal-notebook>docker run -it --rm jupyter/minimal-notebook which start-notebook.sh
/usr/local/bin/start-notebook.sh
D:\opt\docker-stacks\minimal-notebook>docker run -it --rm jupyter/minimal-notebook env
PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=190b30ec492e
TERM=xterm
DEBIAN_FRONTEND=noninteractive
CONDA_DIR=/opt/conda
SHELL=/bin/bash
NB_USER=jovyan
NB_UID=1000
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
HOME=/home/jovyan

The script is executable, it's in the PATH, it's found by which, yet on container start the error indicates the script cannot be found. Interesting.

One more question: I'm assuming your start command is docker run -it --rm -p 8888:8888 jupyter/minimal-notebook (but using whatever name you assigned to your build). Is this correct?

I am running it according to the docs and rebuilt locally with the jupyter/minimal-notebook name:

docker run -d -p 8888:8888 jupyter/minimal-notebook

this way, I look at the logs via docker logs <container>, I did not know about the -it --rm combo, which directly gives

D:\opt\docker-stacks\minimal-notebook>docker run -it --rm -p 8888:8888 jupyter/minimal-notebook
[FATAL] Executing child process 'start-notebook.sh' failed: 'No such file or directory'

I've got a Windows VM setup finally. When I've got some cycles, I'll give building a shot there.

I've got a Windows VM setup finally.

FWIW, if you still need to set up the docker env on that VM, I can share my setup with you to reduce the Windows-induced friction.

Was there any resolution to this issue? I'm receiving the same error building the images locally in Windows 10 pro.

@aaronsutton hi, I ran into similar issue on Win7 and found the solution here: http://willi.am/blog/2016/08/11/docker-for-windows-dealing-with-windows-line-endings/
In short, try cloning this project with Unix line endings:
git clone https://github.com/jupyter/docker-stacks.git --config core.autocrlf=input

I never was able to reproduce the problem and this issue has been idle for many months. If the line endings suggestion fixed it, it would be great to get that added to the README or the https://github.com/jupyter/docker-stacks/wiki/Docker-recipes wiki page for others in a PR.

Was this page helpful?
0 / 5 - 0 ratings