I am following this guide to build an environment to develop an facial recognition project in.
I’ve pulled the image provided in the guide as shown here using the command
docker pull colemurray/medium-facenet-tutorial in the Desktop Docker.
I am running a container with the image but I do not understand how I can develop an application in it (e.g having access to the modules downloaded in Docker)
The only action I think I can take here is opening the CLI of the container as shown here but I can’t find any guide to use it to add the local folder into the environment.
I understand that using anaconda, I’ll just have to activate a environment and run jupyter notebook to develop in that environment and I am trying to do the exact same thing with Docker, but I fail make the same connection, any advice will be greatly appreciated.
You have three options here:
- Keep the
Dockerfilein your workdirectory and adding a copy command in
Dockerfilethat will copy your python files inside docker container. So at the build time your container is built with with the files in it.
ADD $PWD/requirements.txt /requirements.txt RUN pip3 install -r /requirements.txt ADD $PWD/ / #This will add all your workdirectory files in container
After that you can access it through
You can use
docker cpcommand to copy your files in running docker container and then access it using bash.
You can mount your workdirectory using
-vflag while running to access whole workdirectory inside container and then run using bash.
docker run -it -v /path-to-your-wd:/ colemurray/medium-facenet-tutorial
This will bind your workdirectory at
/ location inside docker container.