Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting operating system error 5 #7

Open
VenkateshSrini opened this issue Dec 21, 2019 · 0 comments
Open

getting operating system error 5 #7

VenkateshSrini opened this issue Dec 21, 2019 · 0 comments

Comments

@VenkateshSrini
Copy link

Hi,
I tried to dockerize the nerd-diner based on your blog
https://blog.sixeyed.com/dockerizing-nerd-dinner-part-1-running-a-legacy-asp-net-app-in-a-windows-container/

My docker file is as below

#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat 

FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019
# Install SQL Server LocalDB
RUN Invoke-WebRequest -OutFile c:\SqlLocalDB.msi -Uri http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x64/SqlLocalDB.MSI  
RUN ["cmd", "/S", "/C", "c:\\windows\\syswow64\\msiexec", "/i", "c:\\SqlLocalDB.msi", "IACCEPTSQLLOCALDBLICENSETERMS=YES", "/qn"]  
RUN & 'C:\\Program Files\\Microsoft SQL Server\\110\Tools\\Binn\\sqllocaldb' start "v11.0"

# Setup app pool for LocalDB access
RUN Import-Module WebAdministration;  \
    Set-ItemProperty 'IIS:\\AppPools\\DefaultAppPool' -Name 'processModel.loadUserProfile' -Value 'True'; \
    Set-ItemProperty 'IIS:\\AppPools\\DefaultAppPool' -Name 'processModel.setProfileEnvironment' -Value 'True'
    
EXPOSE 80
WORKDIR /inetpub/wwwroot
COPY . .

On trying to access the db I'm getting the below exception

CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'c:\inetpub\wwwroot\App_Data\aspnet-NerdDinner-20120906143403.mdf'.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
My web.config file has the following settings

<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-NerdDinner-20120906143403;Integrated Security=SSPI;AttachDBFilename=c:\inetpub\wwwroot\App_Data\aspnet-NerdDinner-20120906143403.mdf" providerName="System.Data.SqlClient" />
    <add name="NerdDinnerContext" connectionString="Data Source=(localdb)\v11.0; Initial Catalog=NerdDinnerContext-20120906143708; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=c:\inetpub\wwwroot\NerdDinnerContext-20120906143708.mdf" providerName="System.Data.SqlClient" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant