I have a docker container created from an alpine image and am running it on docker-desktop on Windows 10 pro. The purpose is to use it as an sftp server.
I have mounted my D drive as a volume in the docker-compose file.
In the entrypoint script i create two folders folder1 and folder2 in the container, at the location of the mounted volume using the following script segment:
log "Creating folder structure"
if ! [ -d "/home/foo/mountlocation/folder1" ]
then
`mkdir -p /home/foo/mountlocation/folder1`
log "folder1 created!"
fi
if ! [ -d "/home/foo/mountlocation/folder2" ]
then
`mkdir -p /home/mountlocation/folder2`
log "folder2 created!"
fi
When running docker-compose up, i see all three of these log statements output to the console.
Both folders, folder1 and folder2 are created and appear in my D drive.
When i bash into my container, cd
ing to the /home/foo/mountlocation/ folder and using the ls -a
command, folder2 is listed as the folder's only contents.
If i create a folder, folder3, along side the folder1 and folder2 in the D drive in Windows, then ls -a
again in the container, folder 2 and folder3 are displayed.
I can cd
into folder1, even though it isn't listed.
I can print the name of the current folder with the command
printf '%s\n' "${PWD##*/}"
and the output is
folder1
.
When i sftp into the container, folder1 is not visible.
I need both folders created by the entrypoint script to be visible.
How can it exist but not be visible? How can I make it so when i build and bring up the container, both folders are visible?