I'm trying to copy my entire home directory or at least make it available to my docker build, but I get the following error:
error from sender: open .Trash: operation not permitted
These are the instructions I was writing for myself:
Run docker build from
~/username
(which makes everything starting at username available) e.g.:/Users/miranda9
then run:
docker build -t test:latest -f py_repo/pycoq_dockerfile/Dockerfile .
But I get the error I mentioned above. Is there a way around this?
My attempt is based on this answer.
Current docker file:
# FROM ubuntu:20.04
FROM ubuntu:18.04
# after this cmd RUN pwd should print /miranda9
WORKDIR /miranda9
# The COPY instruction copies new files or directories from <src> and adds them to the filesystem of the container at the path <dest>.
COPY . .
I'd also prefer to not have to remake the image each time. e.g. just running my container as if it was a command would be best. But I am also curious to see a solution that requires rebuilding the image.
Related question I asked many years ago: How to use a python library that is constantly changing in a docker image or new container?
Attempt 2: solution without a docker file but using mounts volumes
I wanted to avoid entirely using a docker file but I couldn't get that working:
# docker run -v /Users/miranda9:/home/miranda9 -ti continuumio/miniconda3 bash
# docker run -v /Users/miranda9:/ -ti continuumio/miniconda3 bash
gives error:
docker: Error response from daemon: invalid volume specification: '/host_mnt/Users/miranda9:/': invalid mount config for type "bind": invalid specification: destination can't be '/'.