I have a very strange issue with copying the contents of subdirectories to a Docker container.
This is the directory structure:
Note: There are two Dockerfiles, I use the one on the upper level for test purposes. Ignore the one in the WebApp folder.
I want to copy the directories Bilder and JSON to the container, including all contents, but it doesn’t work. The folders in the container will be empty. However, copying the Testdir does indeed work.
This is part of my Dockerfile:
FROM python:3.7-buster # -- Init -- RUN mkdir -p /app/src WORKDIR /app/src ADD WebApp/Testdir ./Testdir #works ADD WebApp/Bilder ./Bilder #doesn't work CMD ["sleep", "50"] #to check contents
I build the image as part of a docker-compose.yml file with
docker-compose build test
Does anyone have a clue what’s happening here? I’ve been searching for a solution for quite some time…
Source: Docker Questions