#amazing thanks for sharing Xanthia8271
1 messages · Page 1 of 1 (latest)
The main issue with running that is you have to decide where you're going to keep the main CrcuitPython Repo.
I actually use git on the host system to d/l the repo to local drive, and then use a --mount option when I run the image so that it's visible in there.
That has the huge advantage that I don't need to mess with USB inside the container to upload the uf2 file, just drag and drop it over using Explorer on the host.
You could, in theory, d/l the repo inside the container, I'm 99.999% certain it'll build fine like that. You'd just need to figure a way to get the resulting binary from the image's vhd to the device.
nice solution to mount the source in volume
Mount option I use is:
--mount src=C:\Etc\CircuitPython,target=/mnt/circuitpython,type=bind
One other thing, it'll take a while with default settings, I have an 8 core (16 thread) cpu here, so I allocate 6 cores to the container with the --cpus=6 option to docker run, and then run make on the inside with a -J 6 option so it uses all six cores. That saves a ton of time, trust me. 🙂
in the dockerfile you clone cp too?
ahh ok just to install the requirements
can you also share the complete docker run please?
docker run -it --rm --name python --mount src=C:\Etc\CircuitPython,target=/mnt/circuitpython,type=bind --cpus=6 python
-it for interactive. --rm is optional, I'm in the habit of treating build containers as completely ephemeral.
Also, in the build command I tag the image as python:latest. That's how the run command can find the image from the python on the end.
docker build -t python:latest .
fantastic, I will test it later. thank you very much for your detailed instructions
You're welcome, always glad to help.
one last question, might it be better to clone the same cp commit (in the image) like the base you locally cloned in c:/etc/circuitpython?
to avoid missing/wrong dependencies in the image
It probably would be best to do that. IIRC from the docs, it mentions that most of the time those two files don't change, but they do occasionally. So (for example) I would not be at all surprised if they changed between 7.3.3 and the new 8.0.0 that's in the works.