C1W1: docker run

Hello staff,

docker run does not work for me.
Neither in docker command window
docker run -it --rm -p 8888:8888 -p 8000:8000 --mount type=bind,source="(pwd)”,target=/home/jovyan/work deeplearningai/mlepc1w1-ugl:jupyternb
/bin/sh: 2: docker: not found
" nor in windows command window: "C:\Users\xyz>docker run -it --rm -p 8888:8888 -p 8000:8000 --mount type=bind,source="(pwd)“,target=/home/jovyan/work deeplearningai/mlepc1w1-ugl:jupyternb
docker: Error response from daemon: invalid mount config for type “bind”: invalid mount path: ‘$(pwd)’ mount path must be absolute.
See ‘docker run --help’.”

I also deactivated the firewall. Nevertheless could only once reach the follwoing output in Docker logs:
“2022-12-22 17:00:41 [I 16:00:41.527 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
2022-12-22 17:00:42 [W 2022-12-22 16:00:42.812 LabApp] ‘ip’ has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
2022-12-22 17:00:42 [W 2022-12-22 16:00:42.812 LabApp] ‘port’ has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
2022-12-22 17:00:42 [W 2022-12-22 16:00:42.812 LabApp] ‘port’ has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
2022-12-22 17:00:42 [W 2022-12-22 16:00:42.812 LabApp] ‘port’ has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
2022-12-22 17:00:42 [I 2022-12-22 16:00:42.819 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.8/site-packages/jupyterlab
2022-12-22 17:00:42 [I 2022-12-22 16:00:42.819 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
2022-12-22 17:00:42 [I 16:00:42.823 NotebookApp] Serving notebooks from local directory: /home/jovyan
2022-12-22 17:00:42 [I 16:00:42.823 NotebookApp] Jupyter Notebook 6.2.0 is running at:
2022-12-22 17:00:42 [I 16:00:42.823 NotebookApp] http://81622597426a:8888/?token=9ca4b0686572902e16b2864748de6f64d6eb8eea47425d67
2022-12-22 17:00:42 [I 16:00:42.823 NotebookApp] or
2022-12-22 17:00:42 [I 16:00:42.823 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
2022-12-22 17:00:42 [C 16:00:42.827 NotebookApp]
2022-12-22 17:00:42
2022-12-22 17:00:42 To access the notebook, open this file in a browser:
2022-12-22 17:00:42 file:///home/jovyan/.local/share/jupyter/runtime/nbserver-7-open.html
2022-12-22 17:00:42 Or copy and paste one of these URLs:
2022-12-22 17:00:42 http://81622597426a:8888/?token=9ca4b0686572902e16b2864748de6f64d6eb8eea47425d67
2022-12-22 17:00:42 or
2022-12-22 17:00:40 WARN: Jupyter Notebook deprecation notice GitHub - jupyter/docker-stacks: Ready-to-run Docker images containing Jupyter applications.
2022-12-22 17:00:40 Executing the command: jupyter notebook”

It always says connection could not be eastablished. There was no window which I could use to log in.

Thanks a lot in advance.

Best reagrds :slight_smile:

What os / hardware are you using?

-Windows 10 Home
-AMD Ryzen 5 4600H with Radeon Graphics 3.00 GHz and 16,0 GB (15,4 GB usable)

Based on the error trace, it seems like the command is not properly created.

Unfortunately, I don’t have a windows machine. I’ve asked other mentors with access to a windows 10 home edition machine to reply to this topic. While you wait, try github / stackoverflow.

Dear staff,

How can I ensure to be on “week1-ungraded-lab”?
Additionally, it says “Not connected to Hub” in the bottom line of the Docker GUI.

Maybe the screenshot below helps to understand the topic.

Thanks a lot :slight_smile:

Which OS is this?

Could you please share the outputs of the following commands?

docker image rm -f hello-world
docker run hello-world

Hi Simon_Seit, I use Window OS and it is possible your system requirements is not compatible for WSL2 to run:

  • The following hardware prerequisites are required to successfully run WSL 2 on Windows 10 or Windows 11:

Please check if your BIOS contains those features. If not, I’m afraid you have to upgrade your OS to Window 10 Pro or Enterprise or Education.

In my personal experience, I had to upgrade to Window 10 Pro when I used Docker

Hi, I used Windows 10 Pro, and the code should work fine on Visual Studio Code. If you used GitBash, $(pwd) might raise errors, so you need to do path conversion

To be sure the container is mount to week1-ungraded-lab. You should have a MOUNT row in your inspect menu.

Run the following command in your terminal before you run any Docker commands

cd MLEP-public/course1/week1-ungraded-lab

For the “Not connected to Hub”, it means you are not signed in to your DockHub account, which is used to share containers for your teams.

Windows 10 Home as mentioned above: C1W1: docker run - #3 by Simon_Seitz

output is:
docker image rm -f hello-world /bin/sh: 1: docker: not found docker run hello-world
/bin/sh: 2: docker: not found

Thanks for the hints:
I did the installation of Hyper-V and activated the features.

Please see the screenshot below for my output for “MOUNT”:

I also tried it without the " ’ " after “lab” since I thought it was a typo. But still same output.

You should run the command on Poweshell or VScode. The Docker default terminal is for Docker command line, if you want integrated terminal, follow this instructions

When you go to INSPECT and can’t find MOUNT in that container, it means it hasn’t been mounted to week1-ungraded-lab

I also tried it in the powershell:

Still mount is not found and port is not bound

Do you know how to fix it?

Hello @Simon_Seitz , have you already cloned the MLEP repo in your local computer?
If yes please open your command prompt (CMD) and paste the following cd machine-learning-engineering-for-production-public\course1\week1-ungraded-lab

please let me know the output

no, shouldn’t the environment run on the docker image?

from where do I get the repo? Please provide the link?

Hi @Simon_Seitz
Follow @Isaak_Kamau advice, because you are in the default path, you should write the whole path to week1-upgraded-lab
For example, if your cloned repo is in the Documents folder, use the command

cd C:\WINDOWS\system32\Documents\machine-learning-engineering-for-production-public\course1\week1-ungraded-lab

Afterward, run a container from the pulled Docker imaged in that directory

docker run -it --rm -p 8888:8888 -p 8000:8000 --mount type=bind,source=“$(pwd)”,target=/home/jovyan/work deeplearningai/mlepc1w1-ugl:jupyternb

Hi, @Simon_Seitz
Follow the Introduction to get the repo.

The instruction is specifically designed to run locally on your machine. This can be done via 2 methods: using Python Virtual Environments via Conda or using Docker . Since you choose to use the Docker method, it doesn’t require a virtual environment

Hello @Th_o_Vy_Le_Nguy_n I also guess that @Simon_Seitz don’t already have the repository in his local machine?

@Simon_Seitz Please try to follow this steps and tell us the feedback.

  • Install Git B ash in your computer if you don’t have it here is the link https://gitforwindows.org/

  • Open the git after installation, (It’s very similar with CMD)

  • Run this command first: cd (It should print nothing)

  • secondly run this command: pwd (It will print you current working directory take note of it)

  • Thirdly run this command: git clone https://github.com/https-deeplearning-ai/machine-learning-engineering-for-production-public.git (Wait until it finishes downloading all the files in your working directory that was printed when you ran the 2nd comand i.e pwd

  • Now run this command: cd machine-learning-engineering-for-production-public/course1/week1-ungraded-lab (still in Git Bash)

  • Run: ls (It will show you now all the files you have downloaded)

  • Run this: pip install -r requirements.txt

  • Finally run this: jupyter lab

Please let us know if you get stuck anywhere. Ussualy errors happen due to different versions we might be using.

Note I have intentionally skipped this 2 commands conda create --name mlep-w1-lab python=3.8 and conda activate mlep-w1-lab since I don’t know whether you have conda installed in your system.

If this works we can now proceed to method number two of using docker

1 Like

thanks a lot for hint.
I thought that everything runs on the Docker.

I downloaded the git repo, couldn’t install the requirements via git bash.
I install them via windows command window and conda environment.

(I read in Setting Up Conda in Git Bash - Tips and Resources - Codecademy Forums that adding " ```
echo “. ${PWD}/conda.sh” >> ~/.bashrc

After closing and opening git bash, they advised to type in "conda activate", but still same output for me.)

Please see:
/d/coursera/machine-learning-engineering-for-production-public/course1/week1-ungraded-lab (main)
$ pip install -r requirements.txt
bash: pip: command not found

MINGW64 /d/coursera/machine-learning-engineering-for-production-public/course1/week1-ungraded-lab (main)
$ conda
bash: conda: command not found

How to make the git bash runnable for the conda and how to run the "jupyter lab" (does not work via windows command window)?
output of windows command window:
"(mlep-w1-lab) C:\Users\xyz>jupyter lab
'jupyter' is not recognized as an internal or external command,
operable program or batch file."

Thanks a lot in advance :slight_smile:

Hi @Simon_Seitz This error could mean that you have not installed python in your system. That’s why we suggested using Conda since it contained all the necessary bundles

Conda command only works in Anaconda Prompt, so it won’t work when you use the window command

When you created a virtual environment in Conda, it won’t preinstalled JupyterLab like (base) since it doesn’t know if you need it. So this error means you haven’t installed it (mlep-w1-lab) environment.

I have tested Git Bash and Conda so please try these steps:

1. Use GitBash to clone repo (Skip this if you have successfully received all the contents)

git clone GitHub - https-deeplearning-ai/machine-learning-engineering-for-production-public: Public repo for DeepLearning.AI MLEP Specialization

  • Check the file contents

cd MLEP-public/course1/week1-ungraded-lab


It should show you these files

└── week1-ungraded-lab (this directory)
├── images (includes some images from ImageNet)
├── server.ipynb (Part 1 of the ungraded lab)
├── client.ipynb (Part 2 of the ungraded lab)
└── requirements.txt (python dependencies)

Now close GitBash and open Conda or Miniconda to install dependencies from requirements.txt
2. Open Anaconda Prompt (You can search it on your window)
This ensure you will run everything on conda environment

  • Creating a virtual Environment

conda create --name mlep-w1-lab python=3.7

  • Once everything is installed, activate the environment

conda activate mlep-w1-lab

  • Run this command to go to week1-upgraded-lab

cd MLEP-public/course1/week1-ungraded-lab

  • Now you should be able to install python dependencies inside conda environment

pip install -r requirements.txt

  • Now you can open jupyterlab

jupyter lab

  • NOTE: If it give error :
'jupyter' is not recognized as an internal or external command, operable program or batch file."

Install Jupyter Lab with conda directly. Make sure you are still at (week1-upgraded-lab) environment

conda install -c conda-forge jupyterlab

jupyter lab

Tell me if this help your issue

@Simon_Seitz please try this solution from @Th_o_Vy_Le_Nguy_n

If you still get an error please let us know. We can also plan for a live support and solve the bugs together if it’s okay with you?