Closed Drewster727 closed 6 years ago
@Drewster727 I'm not sure I understand what you're asking. Forgive my ignorance - I don't know anything about Octopus deploy. What exactly is the problem you're having with our docker container?
@natemcmaster no worries, I fought with it like all day and got it resolved.
For anyone that might need this: I ended up:
No need for dotnet restore/publish inside the container if you follow those steps.
Guys,
I'm having an interesting issue regarding my aspnetcore 2 app with my CI/CD pipeline. Here's the facts:
Steps to reproduce the issue
dotnet pack the project,
I get the following inside the nupkg. Notice no .cs files (because it's been built).
upload nupkg to Octopus, deploy the files to a server, then try to use the following Dockerfile:
This dockerfile fails when building on the "RUN dotnet restore" line, which I understand is because it cannot find a .csproj to restore from. OK, so if I start over and include my .csproj via an include (in the csproj itself w/ "pack" set to true), it'll get added.
So, if I retry this. I get a little bit further. I now build my docker again and this time I have the csproj inside the nuget. This time it restores everything, and I get to the "RUN dotnet publish -c Release -o out" line. It fails:
It would appear it's missing my .cs files in order to build.
OK -- at this point it seems clear that maybe I don't NEED to run dotnet publish in my dockerfile? If I comment that out, the docker build succeeds. When I go to run it, I get:
I understand that if I've already "packed" my app it is essentially building it and I don't need to do that again, but I cannot get the app to run inside the docker if I skip those steps.
You're probably asking why don't you just docker build locally and push it to your docker repo. I'm not doing that because that's outside my CI/CD pipeline. I need octopus to handle transformations first.
Output of
dotnet --info
Output of
docker info