I created a Docker container from Windows PowerShell for dolphinx with the command available in the Readme.md for dolphinx package. The container is running and I installed a couple of helper extensions for VS Code for using Docker.
My question is that I would like to know how to start a new Python file and have:
from fenics import *
mesh = UnitCube(8,8)
start to pull in all of the dependancies for dolphinx. So far UnitCube is not being found as a function although the example I have states that it should be. VS Code does see some containers and images however I wasn’t able yet to get the two lines of Python source code above to start to work yet.
Anyone know how to get this going either for Windows and/or WSL2 for Ubuntu 22.04 that I also have installed? I was hoping I could get docker to pull into Python the whole fenics module that should contain UnitCube function to run some examples from VS Code.
Can you share those examples? A container is just an isolated environment. If you know how it should work without containers on the same platform, it should work in containers too.
I chose WSL option when installing on Windows. I noticed so far after that pull I have.
wsl --list
Windows Subsystem for Linux Distributions:
Ubuntu-20.04 (Default)
docker-desktop (new)
docker-desktop-data (new)
Ultimately I will need to do two things. First I have to build dolfinx for cpp and python inside the container and have the build and configuration be remembered it. Secondly I would like to have a way to connect VS Code from windows desktop into the container to code projects inside the container.
Anyone can help me?!
Someplace I got the notion I have to name the container somehow? Really perplexed so far first time using Docker.
What are those new WSL’s on --list? why seperate one for data?
So far dolfinx does build and install inside the container cpp and python. I am still having difficulties getting vs code to connect to the container to start a python code example. no ports are stated as available to connect…
My guess is that this way Docker Desktop can be updated more easily, but I never really cared enough to find out the reason
So your issue is solved? I hope, because I didn’t understand all of your questions. For example “naming the container”.
Note: Please, next time format your posts according to the following guide: How to format your forum posts
In short: please, use </> button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.
I would call the issue resolved it at this point. There are so many extensions docker for vs code it took a while to find the right one. It seems that in windows docker gui handles naming very well. I’m not sure how things will work for naming on Ubuntu but I suppose if there were any problems cropping up that would be a new issue for linux.