Most ongoing software and machine learning development are going to be conainerized. One of my development environment includes Conda python package manager and Jupytor note book server. VS code will be running Jupyter notebook client connect from host side. Here is the procedure to set up this environment. There is no need to map container port.

first you need to get container ip address by command "ip" or "ifconfig". A container's ip adddress are usually 172.2.0.*:

$ ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.2 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet)

here my container ip address is 172.17.0.2

Next start container to listen to all ip address and port 80. The port number is up to you.

$ jupyter notebook --ip=0.0.0.0 --port=80

server will start, and it should print a token on screen:

Copy the token value. Here my token is

898dcbb21c2df9b224b1ce56638ceab721e961c8fe5d1b96

Now in host open browser and input this url

http://172.17.0.2:80

you will be asked for the token, now paste the token copied in last step.

If you have installed Jupyter plugin to VS code,  now you can easily connect to Jupyter server from there.

Categories: Deep Learning

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *