Docker Community Forums

Share and learn in the Docker community.

Sub-Folder can't access in the application


#1

Good Morning.

I’ve tried to create a docker image with the application of my company. An ASPNET application. I used this configuration:

FROM microsoft/windowsservercore:ltsc2016

SHELL ["powershell"]

RUN Install-WindowsFeature NET-Framework-45-ASPNET ; \
    Install-WindowsFeature Web-Asp-Net45

RUN mkdir c:/inetpub/wwwroot/app

COPY /RELEASE/ c:/inetpub/wwwroot/app

RUN Remove-WebSite -Name 'Default Web Site'

RUN NEW-WebSite -Name 'apptest' -Port 8085 -PhysicalPath 'c:\inetpub\wwwroot\app' -ApplicationPool '.NET v4.5'

Well… When I run the application, the index page came. But all the other files cannot up (the css files, the js files… all this files becomes in sub-folders). So, just the principal file index, in the root (or the files in the root) can be accessed.

I realize taht when I run the DevTools from Chrome, and, in the Sources, it has the references from the sub-folders and the archives, but, when I click in then, all of them is blank (its not occur in the IIS in the Windows Server system, just in the docker).

Can anyone help me with that?


(Ove "Lime" Lindström) #2

I think it has to do with the way COPY handle file path matching (https://golang.org/pkg/path/filepath/#Match).

COPY /DIR/ matches exactly that directory and nothing else.
COPY /DIR matches every path that starts with that directory.


#3

Hi. I’ve tried this. Unfortunately it not works. It was the same effect like COPY /DIR/. In the terminal, I can see the files, but in the browser (Chrome) it’s not load the files =/


(Ove "Lime" Lindström) #4

When you say “in the terminal”, do you attach to the running container and see the files where they are supposed to be or where do you look when you use the terminal?


#5

I see the files when I attach the terminal. Navigate into the sub-folder and even open the files with type command, and I can see the code.