Comments on: Why Docker: The Docker CLI Through Examples https://code-maze.com/why-docker-docker-cli-examples/ Learn. Code. Succeed. Wed, 02 Sep 2020 19:52:06 +0000 hourly 1 https://wordpress.org/?v=6.7.5 By: TheTrigger https://code-maze.com/why-docker-docker-cli-examples/#comment-634 Sat, 23 Feb 2019 09:48:28 +0000 https://code-maze.com/?p=1988#comment-634 Hi,
thanks for your guides,
i’m doing the process with my project, but im stuck.
when i use: docker run --rm -it -w /home/app/Promoting/ -v ${PWD}:/home/app microsoft/dotnet:2.2-sdk dotnet build
and docker run --rm -it -w /home/app/Promoting/ -p 8080:6660 -v ${PWD}:/home/app microsoft/dotnet:2.2-sdk dotnet run
my project loses all the nuget packages.
PackageManagerConsole: Unable to find fallback package folder '/usr/share/dotnet/sdk/NuGetFallbackFolder'.

The bin starts and it listens ad ports http->6660 and https->6661
But im unable to navigate the swagger (or any other page)
http://localhost:8080/swagger -> ERR_EMPTY_RESPONSE

CLI:
Hosting environment: Development
Content root path: /home/app/Promoting
Now listening on: https://[::]:6661
Now listening on: http://[::]:6660

]]>
By: TheTrigger https://code-maze.com/why-docker-docker-cli-examples/#comment-718 Sun, 03 Feb 2019 10:52:54 +0000 https://code-maze.com/?p=1988#comment-718 In reply to Vladimir Pecanac.

I’m unlucky, i also tried with your example, same behavior.
(I do not have the 2.0-sdk installed on the PC, but its ok since executed inside docker, correct?)

From Postman: Could not get any response.
It’s not 307 or ssl errors.

PS output after run;
Hosting environment: Development
Content root path: /home/app/AccountOwnerServer
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.

As you can see from the attachment, the nuget packages disappear after the `dotnet build`. But the app inside docker, is running. dotnet restore fix the problem (until next build).
https://uploads.disquscdn.com/images/9eba02f2b58fc57ee10e0975972d7103c7e62c2f1a301b9d63c02b8013482904.jpg

Any ideas? Thanks

]]>
By: Vladimir Pecanac https://code-maze.com/why-docker-docker-cli-examples/#comment-708 Sat, 02 Feb 2019 19:02:57 +0000 https://code-maze.com/?p=1988#comment-708 In reply to TheTrigger.

Hey TheTrigger,

Seems like you made your own project in dotnet core 2.2 instead of 2.0 which we used in our project, and that’s OK.

You probably know that 2.1 and 2.2 introduced some changes to improve security of web applications. Namely, when you are creating application from a Web API template, your application is configured to run in HTTPS instead of HTTP.

So now when you open a port like this -p 8080:6660, you get a 307 Temporary Redirect which means your application tried to redirct you to HTTPS on another port which manifests as ERR_EMPTY_RESPONSE on your screen.

So I can recommend two approaches to solve this problem.
1. You can create a project in .NET Core 2.0 and try to follow along the whole series. This is the option that will work for sure.
2. You can remove app.UseHttpsRedirection(); line from the Configure() method in Startup.cs and open your application on the HTTPS port. If that doesn’t work, try removing https address from the configuration file.

As for the nuget packages, not sure what’s happening there, if the application starts, it probably managed to restore the packages it needs.

There, hope that helps, let me know if you still have a problem.

]]>