Cannot open folder in a docker container - docker

I am really new in working with Docker. Now I want to open a particular folder in the Docker container so that I could save created Jupyter Notebook files. I am doing it on Windows 10.
If I try to do it this way:
docker run -it -p 8888:8888 -v C:/Users/Larry/AI/bootcamp:/home/jovyan/bootcamp --rm --name jupyter jupyter/tensorflow-notebook
I get an error:
C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: invalid mode: /home/jovyan/bootcamp.
If I do it this way:
docker run -it -p 8888:8888 -v /User/Larry/AI/bootcamp:/home/jovyan/bootcamp --rm --name jupyter jupyter/tensorflow-notebook
The container is created and I can create a new Jupyter file, but it is not saved. Does anyone see what is wrong?

This could be related to this issue - the : in C: is confusing the argument parser.
The workaround might be simply to rewrite the volume mount as mentioned in the github issue:
docker run --mount type=bind,source=/path/with:colon,destination=/mnt
Update
docker run -it -p 8888:8888 --mount type=bind,source=C:/Users/Larry/AI/bootcamp,destination=/home/jovyan/bootcamp --rm --name jupyter jupyter/tensorflow-notebook

Related

I am not able to load tensorflow/serving in my docker container using windows powershell by using the following command

docker run -it -v C:\Users\HP\Documents\Deep Learning\potato_project:/potato_project -p 8605:8605 --entrypoint /bin/bash tensorflow/serving
It is showing docker:invalid reference format.
enter image description here
Try your path into quotes:
docker run -it -v "C:\Users\HP\Documents\Deep Learning\potato_project:/potato_project" -p 8605:8605 --entrypoint /bin/bash tensorflow/serving
Its seems its due to the space in the path name

Zeppelin fails to load on docker: logErrors docker zeppelin

First issue I´m having is that I can not pull the base image without specifying the version tag, not a big deal... but I find it odd, after that
docker pull apache/zeppelin:0.8.2
After that I´m able to get the image, but one I try to run it as:
docker run -p 8080:8080 apache/zeppelin:0.8.2
or
docker run -p 8080:8080 --rm --name zeppelin apache/zeppelin:0.8.2
The browser just don´t show any result at the corresponding port: localhost:8080/
In the terminal I get a series of warnings an the following error:
org.glassfish.jersey.internal.Errors logErrors docker zeppelin
Zeppelin Docker documentation is missing. You can find some recent fixes in their repo, e.g. env variable ZEPPELIN_ADDR=0.0.0.0:
docker run --rm -ti \
-p 8080:8080 \
-e ZEPPELIN_ADDR=0.0.0.0 \
--name zeppelin \
apache/zeppelin:0.8.2

How to save and edit a Jupyter notebook in a host directory using official Tensorflow docker container?

I want to use the official Tensorflow docker images to create and edit a Jupyter notebook stored on the host.
I'm a little confused with what switches I need to provide. To run a Tensorflow script on the host the docs suggest:
docker run -it --rm -v $PWD:/tmp -w /tmp tensorflow/tensorflow python ./script.py
..and to run the Jupyter service:
docker run -it -p 8888:8888 tensorflow/tensorflow:nightly-py3-jupyter
When I try merging the switches to run Jupyter + mount the host volume:
docker run -it --rm -v $PWD:/tmp -w /tmp -p 8888:8888 tensorflow/tensorflow:nightly-py3-jupyter
...its still accessing notebooks stored in the container, not the host.
Notebooks are stored inside the container /tf folder, so copying your files there will do the trick:
docker run -it --rm -v $PWD:/tf -p 8888:8888 tensorflow/tensorflow:nightly-py3-jupyter
The first command you mentioned is used to run a TensorFlow program developed on the host machine, not a notebook.

How can I save zeppelin notebook from a docker?

I am using a docker-container for spark-zeppelin. The docker image was fund here,
https://github.com/Gmousse/docker-zeppelin-python3
I can start an image and work using this command,
docker run -it -p 8080:8080 -p 8081:8081 gmousse/docker-zeppelin-python3
To be able to communicate with the host, I have mounted some paths to host with volume flag like this,
docker run -it -v /cephfs:/cephfs -p 8080:8080 -p 8081:8081 gmousse/docker-zeppelin-python3
it works fine. Now to mount the zeppelin working directory I added this,
docker run -it -v /cephfs:/cephfs -v my_path_on_host:/zeppelin -p 8080:8080 -p 8081:8081 gmousse/docker-zeppelin-python3
And this does not run.
In this command actually it is looking for a zeppelin.sh file in /zeppelin and fails.
Any idea, how can I mount a local volume, and be able to save zeppelin notebook on the host?
Thank you for your time, in advance...
It is very handy to store notebooks on local file system especially under version control.
So you need to mount only notebook folder, but you tried to mount whole zeppelin folder and on start container could not find zeppelin files.
Correct mount examples:
docker run \
-p 8080:8080 \
-v /home/user/zeppelin_notebooks:/zeppelin/notebook \
apache/zeppelin:0.8.0
docker run \
-p 8080:8080 \
--mount type=bind,source="$(pwd)"/zeppelin_notebooks,target=/zeppelin/notebook \
--rm --name zeppelin apache/zeppelin:0.8.0
for My apache zeppelin docker hosted on window 10, the pwd is /opt/zeppelin, the default path for notebooks is /opt/zeppelin/notebook, so I mount my window path as below, Therefore, All notebooks are being save in "C:/Zeppelin/notebook"
docker run -p 8080:8080 -v C:/Zeppelin/Data/:/opt/zeppelin/Data/ -v C:/Zeppelin/notebook:/opt/zeppelin/notebook --name zeppelin apache/zeppelin:0.10.0

Why doesn't the docker volume in Windows Server show up when I run this command?

I have a folder setup on the host machine at c:\testvol.
The docker image does not have a folder at c:\testvol.
When I run:
docker run --rm -d --name {name} {imagename} --v c:\testvol:c:\testvol
Why doesn't the volume show up on the container?
It appears in the docker command you need to specify the image name as the last parameter unless you want to pass arguments to be processed by the docker file.
Also, --v should be -v or --volume as --v is not recognized by the docker command.
The command you want is:
docker run --rm -d --name {name} --volume c:\testvol:c:\testvol {imagename}

Resources