site.css styles not being applied to Docker image with Visual Studio 2017 Docker build
up vote
0
down vote
favorite
- I am using Windows to build a Linux container with Visual Studio 2017
- I make a change to site.css in my ASP.Net Core web app, and a minor textual change to the home page to show the app current version.
- I build and debug my docker image locally: SUCCESS (I see the changes)
- I push my image to docker hub: SUCCESS!
- I update my kubernetes deployment to pull the new image from docker hub: SUCCESS (I see the new image pulled, and I see the version change on the home page)
- FAIL: I don't see the css changes!
If I open up the Chrome dev toolbar, it does not appear to be getting the right site.css - I can tell this by inspecting the elements - they have some other css being applied, not mine!
If I view source, it is referencing the minified version of the css file:
<link rel="stylesheet" href="/css/site.min.css?v=kHvJwvVAK1eJLN4w8xygUR3nbvlLmRwi5yr-OuAO90E" />
Here is the OOB Dockerfile from Visual Studio:
FROM microsoft/aspnetcore:2.0 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY SupportTicket.sln ./
COPY ST.Web/ST.Web.csproj ST.Web/
COPY ST.AppServicesLib/ST.AppServicesLib.csproj ST.AppServicesLib/
COPY ST.SharedInterfacesLib/ST.SharedInterfacesLib.csproj ST.SharedInterfacesLib/
COPY ST.SharedEntitiesLib/ST.SharedEntitiesLib.csproj ST.SharedEntitiesLib/
COPY ST.SQlServerRepoLib/ST.SQLServerRepoLib.csproj ST.SQlServerRepoLib/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/ST.Web
RUN dotnet build -c Release -o /app
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ST.Web.dll"]
Question
If I can view the website correctly with a debug build, why is it not appearing correctly in the pushed image? (I expect the images to be identical)
How do I fix this?
Many Thanks!
visual-studio docker
add a comment |
up vote
0
down vote
favorite
- I am using Windows to build a Linux container with Visual Studio 2017
- I make a change to site.css in my ASP.Net Core web app, and a minor textual change to the home page to show the app current version.
- I build and debug my docker image locally: SUCCESS (I see the changes)
- I push my image to docker hub: SUCCESS!
- I update my kubernetes deployment to pull the new image from docker hub: SUCCESS (I see the new image pulled, and I see the version change on the home page)
- FAIL: I don't see the css changes!
If I open up the Chrome dev toolbar, it does not appear to be getting the right site.css - I can tell this by inspecting the elements - they have some other css being applied, not mine!
If I view source, it is referencing the minified version of the css file:
<link rel="stylesheet" href="/css/site.min.css?v=kHvJwvVAK1eJLN4w8xygUR3nbvlLmRwi5yr-OuAO90E" />
Here is the OOB Dockerfile from Visual Studio:
FROM microsoft/aspnetcore:2.0 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY SupportTicket.sln ./
COPY ST.Web/ST.Web.csproj ST.Web/
COPY ST.AppServicesLib/ST.AppServicesLib.csproj ST.AppServicesLib/
COPY ST.SharedInterfacesLib/ST.SharedInterfacesLib.csproj ST.SharedInterfacesLib/
COPY ST.SharedEntitiesLib/ST.SharedEntitiesLib.csproj ST.SharedEntitiesLib/
COPY ST.SQlServerRepoLib/ST.SQLServerRepoLib.csproj ST.SQlServerRepoLib/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/ST.Web
RUN dotnet build -c Release -o /app
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ST.Web.dll"]
Question
If I can view the website correctly with a debug build, why is it not appearing correctly in the pushed image? (I expect the images to be identical)
How do I fix this?
Many Thanks!
visual-studio docker
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
- I am using Windows to build a Linux container with Visual Studio 2017
- I make a change to site.css in my ASP.Net Core web app, and a minor textual change to the home page to show the app current version.
- I build and debug my docker image locally: SUCCESS (I see the changes)
- I push my image to docker hub: SUCCESS!
- I update my kubernetes deployment to pull the new image from docker hub: SUCCESS (I see the new image pulled, and I see the version change on the home page)
- FAIL: I don't see the css changes!
If I open up the Chrome dev toolbar, it does not appear to be getting the right site.css - I can tell this by inspecting the elements - they have some other css being applied, not mine!
If I view source, it is referencing the minified version of the css file:
<link rel="stylesheet" href="/css/site.min.css?v=kHvJwvVAK1eJLN4w8xygUR3nbvlLmRwi5yr-OuAO90E" />
Here is the OOB Dockerfile from Visual Studio:
FROM microsoft/aspnetcore:2.0 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY SupportTicket.sln ./
COPY ST.Web/ST.Web.csproj ST.Web/
COPY ST.AppServicesLib/ST.AppServicesLib.csproj ST.AppServicesLib/
COPY ST.SharedInterfacesLib/ST.SharedInterfacesLib.csproj ST.SharedInterfacesLib/
COPY ST.SharedEntitiesLib/ST.SharedEntitiesLib.csproj ST.SharedEntitiesLib/
COPY ST.SQlServerRepoLib/ST.SQLServerRepoLib.csproj ST.SQlServerRepoLib/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/ST.Web
RUN dotnet build -c Release -o /app
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ST.Web.dll"]
Question
If I can view the website correctly with a debug build, why is it not appearing correctly in the pushed image? (I expect the images to be identical)
How do I fix this?
Many Thanks!
visual-studio docker
- I am using Windows to build a Linux container with Visual Studio 2017
- I make a change to site.css in my ASP.Net Core web app, and a minor textual change to the home page to show the app current version.
- I build and debug my docker image locally: SUCCESS (I see the changes)
- I push my image to docker hub: SUCCESS!
- I update my kubernetes deployment to pull the new image from docker hub: SUCCESS (I see the new image pulled, and I see the version change on the home page)
- FAIL: I don't see the css changes!
If I open up the Chrome dev toolbar, it does not appear to be getting the right site.css - I can tell this by inspecting the elements - they have some other css being applied, not mine!
If I view source, it is referencing the minified version of the css file:
<link rel="stylesheet" href="/css/site.min.css?v=kHvJwvVAK1eJLN4w8xygUR3nbvlLmRwi5yr-OuAO90E" />
Here is the OOB Dockerfile from Visual Studio:
FROM microsoft/aspnetcore:2.0 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY SupportTicket.sln ./
COPY ST.Web/ST.Web.csproj ST.Web/
COPY ST.AppServicesLib/ST.AppServicesLib.csproj ST.AppServicesLib/
COPY ST.SharedInterfacesLib/ST.SharedInterfacesLib.csproj ST.SharedInterfacesLib/
COPY ST.SharedEntitiesLib/ST.SharedEntitiesLib.csproj ST.SharedEntitiesLib/
COPY ST.SQlServerRepoLib/ST.SQLServerRepoLib.csproj ST.SQlServerRepoLib/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/ST.Web
RUN dotnet build -c Release -o /app
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ST.Web.dll"]
Question
If I can view the website correctly with a debug build, why is it not appearing correctly in the pushed image? (I expect the images to be identical)
How do I fix this?
Many Thanks!
visual-studio docker
visual-studio docker
edited Nov 14 at 17:43
asked Nov 14 at 17:14
Banoona
749
749
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Preliminary answer (this is a workaround, and I would still like to get an answer on the central question as to why the debug website container != the deployed container):
Comment out the minifier configuration in bundleconfig.json. This got it working for me. (But now I don't have any minification!):
// Configure bundling and minification for the project.
// More info at https://go.microsoft.com/fwlink/?LinkId=808241
[
//{
// "outputFileName": "wwwroot/css/site.min.css",
// // An array of relative input file paths. Globbing patterns supported
// "inputFiles": [
// "wwwroot/css/site.css"
// ]
//},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
// Optionally specify minification options
"minify": {
"enabled": true,
"renameLocals": true
},
// Optionally generate .map file
"sourceMap": false
}
]
Also, I commented out, and updated, the stylesheet reference in _layout.cshtml:
<environment exclude="Development">
<!-- etc -->
@*<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />*@
<link rel="stylesheet" href="~/css/site.css" />
</environment>
Any better answers, greatly appreciated.
The following link was useful: github.com/madskristensen/BundlerMinifier/issues/217
– Banoona
Nov 14 at 18:18
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Preliminary answer (this is a workaround, and I would still like to get an answer on the central question as to why the debug website container != the deployed container):
Comment out the minifier configuration in bundleconfig.json. This got it working for me. (But now I don't have any minification!):
// Configure bundling and minification for the project.
// More info at https://go.microsoft.com/fwlink/?LinkId=808241
[
//{
// "outputFileName": "wwwroot/css/site.min.css",
// // An array of relative input file paths. Globbing patterns supported
// "inputFiles": [
// "wwwroot/css/site.css"
// ]
//},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
// Optionally specify minification options
"minify": {
"enabled": true,
"renameLocals": true
},
// Optionally generate .map file
"sourceMap": false
}
]
Also, I commented out, and updated, the stylesheet reference in _layout.cshtml:
<environment exclude="Development">
<!-- etc -->
@*<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />*@
<link rel="stylesheet" href="~/css/site.css" />
</environment>
Any better answers, greatly appreciated.
The following link was useful: github.com/madskristensen/BundlerMinifier/issues/217
– Banoona
Nov 14 at 18:18
add a comment |
up vote
0
down vote
Preliminary answer (this is a workaround, and I would still like to get an answer on the central question as to why the debug website container != the deployed container):
Comment out the minifier configuration in bundleconfig.json. This got it working for me. (But now I don't have any minification!):
// Configure bundling and minification for the project.
// More info at https://go.microsoft.com/fwlink/?LinkId=808241
[
//{
// "outputFileName": "wwwroot/css/site.min.css",
// // An array of relative input file paths. Globbing patterns supported
// "inputFiles": [
// "wwwroot/css/site.css"
// ]
//},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
// Optionally specify minification options
"minify": {
"enabled": true,
"renameLocals": true
},
// Optionally generate .map file
"sourceMap": false
}
]
Also, I commented out, and updated, the stylesheet reference in _layout.cshtml:
<environment exclude="Development">
<!-- etc -->
@*<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />*@
<link rel="stylesheet" href="~/css/site.css" />
</environment>
Any better answers, greatly appreciated.
The following link was useful: github.com/madskristensen/BundlerMinifier/issues/217
– Banoona
Nov 14 at 18:18
add a comment |
up vote
0
down vote
up vote
0
down vote
Preliminary answer (this is a workaround, and I would still like to get an answer on the central question as to why the debug website container != the deployed container):
Comment out the minifier configuration in bundleconfig.json. This got it working for me. (But now I don't have any minification!):
// Configure bundling and minification for the project.
// More info at https://go.microsoft.com/fwlink/?LinkId=808241
[
//{
// "outputFileName": "wwwroot/css/site.min.css",
// // An array of relative input file paths. Globbing patterns supported
// "inputFiles": [
// "wwwroot/css/site.css"
// ]
//},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
// Optionally specify minification options
"minify": {
"enabled": true,
"renameLocals": true
},
// Optionally generate .map file
"sourceMap": false
}
]
Also, I commented out, and updated, the stylesheet reference in _layout.cshtml:
<environment exclude="Development">
<!-- etc -->
@*<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />*@
<link rel="stylesheet" href="~/css/site.css" />
</environment>
Any better answers, greatly appreciated.
Preliminary answer (this is a workaround, and I would still like to get an answer on the central question as to why the debug website container != the deployed container):
Comment out the minifier configuration in bundleconfig.json. This got it working for me. (But now I don't have any minification!):
// Configure bundling and minification for the project.
// More info at https://go.microsoft.com/fwlink/?LinkId=808241
[
//{
// "outputFileName": "wwwroot/css/site.min.css",
// // An array of relative input file paths. Globbing patterns supported
// "inputFiles": [
// "wwwroot/css/site.css"
// ]
//},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
// Optionally specify minification options
"minify": {
"enabled": true,
"renameLocals": true
},
// Optionally generate .map file
"sourceMap": false
}
]
Also, I commented out, and updated, the stylesheet reference in _layout.cshtml:
<environment exclude="Development">
<!-- etc -->
@*<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />*@
<link rel="stylesheet" href="~/css/site.css" />
</environment>
Any better answers, greatly appreciated.
edited Nov 14 at 18:20
answered Nov 14 at 18:14
Banoona
749
749
The following link was useful: github.com/madskristensen/BundlerMinifier/issues/217
– Banoona
Nov 14 at 18:18
add a comment |
The following link was useful: github.com/madskristensen/BundlerMinifier/issues/217
– Banoona
Nov 14 at 18:18
The following link was useful: github.com/madskristensen/BundlerMinifier/issues/217
– Banoona
Nov 14 at 18:18
The following link was useful: github.com/madskristensen/BundlerMinifier/issues/217
– Banoona
Nov 14 at 18:18
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305523%2fsite-css-styles-not-being-applied-to-docker-image-with-visual-studio-2017-docker%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown