How do you start the docker container when you want to use it in vscode?
Usually, one would add a —name=name-of-my-container
, so that next time you want to run code, you call docker container start -i name-of-my-container
rather than docker run …
Hamza_Zaheer:
I asked ChatGPT for help, and it suggested installing Conda and then adding libraries like ParaView. I did that — the library shows up in the terminal, but when I run a script, it’s not recognized.
Also, when I rerun the container, all the Conda environments and libraries disappear. I’m currently doing a course, and my professor provided me with container files that are automatically configured in VS Code. However, the examples from the Fenicsx website don’t work with those containers.
If you are using the dolfinx docker containers, don’t add conda to the mix.
I would keep Paraview outside the docker image, as it uses a GUI, which can be a hassle to get to work through docker. Paraview provide binaries on their webpage that you can use.
Hamza_Zaheer:
How can I use Fenicsx efficiently with VS Code?
You should use it with Dev Containers - Visual Studio Marketplace
as it lets you attach a docker container to vscode.
See for instance:
You are here mixing two different ways of using DOLFINx:
Using conda; This creates a virtual environment on your computer. If you install jupyterlab in conda, you can use it without having to consider sharing files (as you are on your own system).
Using docker. Docker creates a virtual machine, which has its own file system, and you would have to share directories (mount volumes in docker-lingo) to being able to save them. Also, as you do not give your docker container a name when you start …
The -v and -w does not change the context when changing image. These images simply have different entry points (and the lab images has some additional dependencies to run jupyter-lab).
If you do not use name when you do run docker creates a container with a random name sharing the directories with the docker container. This does not mean that your files created and executed in /root/shared in the container will disappear when you close the container, but you will keep using memory creating ne…
for similar questions