when I execute
" eval “$(docker-machine env dev)” "
I get:
“Docker machine “dev” does not exist. Use “docker-machine ls” to list machines. Use “docker-machine create” to add a new one”
the command
“docker-machine ls”
gives
“NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS”
I am not sure what do I need to create…
Following the suggestion:
“path=(pwd); echo {path}”
works and shows the correct path of the current directory
“path=(pwd); docker run -ti -v {path}:/home/fenics/shared quay.io/fenicsproject/stable:latest”
or any docker command after “path=$(pwd);” gives
“zsh: command not found: docker”
At this point I have to open a new terminal in order the docker command
to work again and start fenics.
Note that I also get
“zsh: command not found: docker”
If I input
“docker run -ti -v (pwd):/home/fenics/shared quay.io/fenicsproject/stable:latest"
instead of
"docker run -ti -v {pwd}:/home/fenics/shared quay.io/fenicsproject/stable:latest”
I installed docker stable for Mac yes from the link you shared, .dmg file…
As far as I understand the file on the host I want to share with fenics is in /Users
“/Users/‘myname’/Desktop/my-work-directory”
so the link you sent me said it should work.
The command I suggested here should mount you in the directory /home/shared, which should contain the files you are sharing. I removed FEniCS from this command on purpose, to show you that this is simply your docker not being set up correctly.
Then, as I have said multiple times now, you have not set up docker correctly.
Please go through the steps here to ensure that you have done things correctly:
try for instance:
$ docker run -it -v ~/Desktop:/Desktop r-base bash
and check that your directory has been shared in the folder Desktop
Try to share it to /Desktop, as that worked above…
I cannot be of further assistance, as you have the commands to share a directory to the folder /Desktop.
So, according to you, the following worked: docker run -it -v ~/Desktop:/Desktop r-base bash
On my own computer, the desktop only has a test directory, thus it shows the following:
jsd55@desktoppc:~/Documents/src/dolfinx/python/demo/pyvista$ docker run -it -v ~/Desktop:/Desktop r-base bash
root@d5400c7477fa:/# ls Desktop/
test
Similarly I can do this with the Ubuntu 20.04 image:
jsd55@desktoppc:~/Documents/src/dolfinx/python/demo/pyvista$ docker run -it -v ~/Desktop:/Desktop ubuntu:20.04
root@8f591686e727:/# ls Desktop/
test
or with the fenics image
jsd55@desktoppc:~/Documents/src/dolfinx/python/demo/pyvista$ docker run -it -v ~/Desktop:/Desktop quay.io/fenicsproject/stable:latest
# FEniCS stable version image
Welcome to FEniCS/stable!
This image provides a full-featured and optimized build of the stable
release of FEniCS.
To help you get started this image contains a number of demo
programs. Explore the demos by entering the 'demo' directory, for
example:
cd ~/demo/python/documented/poisson
python3 demo_poisson.py
fenics@e1de04266cfb:~$ ls
.bash_logout .bashrc .profile WELCOME fenics.env.conf shared/
.bash_profile .config/ .sudo_as_admin_successful demo/ local/
fenics@e1de04266cfb:~$ ls /Desktop/
test
As you can see when using the fenics image, your starting location is home/fenics, while your shared folder is located at /Desktop. Thus changing it to:
jsd55@desktoppc:~/Documents/src/dolfinx/python/demo/pyvista$ docker run -it -v ~/Desktop:/home/fenics/shared quay.io/fenicsproject/stable:latest
# FEniCS stable version image
Welcome to FEniCS/stable!
This image provides a full-featured and optimized build of the stable
release of FEniCS.
To help you get started this image contains a number of demo
programs. Explore the demos by entering the 'demo' directory, for
example:
cd ~/demo/python/documented/poisson
python3 demo_poisson.py
fenics@05549cf91a6e:~$ ls
WELCOME demo fenics.env.conf local shared
fenics@05549cf91a6e:~$ ls shared/
test
fenics@05549cf91a6e:~$
Now, the shared folder is inside /home/fenics/shared.