0

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, cding 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?

Raptop
  • 169
  • 2
  • 13

1 Answers1

0

The issue was resolved. The mounted folder on the host was on a USB drive and it seems it wasn't playing well with docker. I changed the mount folder to a hdd location on the host and it works fine.

Raptop
  • 169
  • 2
  • 13
  • Do we need to specify `filesystem `? – Mayur Apr 30 '19 at 11:35
  • This is a good question, which i don't have the answer to. I understand it is not the usual usecase to map a usb flash drive as a volume to a docker container. – Raptop May 01 '19 at 03:18