So, I’ve wrote this dockerfile and it does the bare minimum. It allows a python coded discord bot to be run inside a docker container.
FROM python:3.10
ADD bot.py .
RUN pip install --upgrade pip
RUN pip install discord {other packages}
CMD [ "python", "./bot.py" ]
However, whenever I want to make changes to the code of the discord bot, I have to come back to this dockerfile and rebuild the image, then go into docker and build a new container from the newly rebuilt image. In an Ideal world, it would be great if all I had to do was replace the python file and, if needed, alter another file or an enviroment variable to add any new packages.
Problem is, I’m very new to this and I have very little idea how it would be done.
So for left: I’m going to be running this application on TrueNAS as a custom app, so I can’t really ensure that the the yaml file is in the same folder as the discordbot and dockerfile.
As for the right: yeah, that is a misunderstanding on my part. Should it just be “/.”?
To be more precise, you referred to bind mounting. There is a “synchronized file share” feature which is different and that is for Docker Desktop.
As Christophe correctly wrote
the right side is the path in the container and using the relative path was suggested only for the left side. If you can’t use the relative path, that’s okay. The absolute path will work too for mounting folders into containers. The context matters only when building images and copying files into the image. The relative path is just preferred in general when working locally.