Learn MS NET | Linux

Our journey learning how to write .NET

Learn MS NET

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

How to update a Docker container to the latest version


Having needed to update some Docker containers and getting familiar with how Docker works I though I would post this here so I have it for reference and if anyone else is looking to do the same thing.On my installation of docker I run DotNet Core in containers and with each new update to the SDK new containers get published and it becomes necessary to update them every month or so.As we can see on my installation at the moment the 2.2 versions are 4 months old PS C:\WINDOWS\system32> docker images | findstr "dotnet" mcr.microsoft.com/dotnet/core/sdk 3.0-buster 3930ade3a33a 4 days ago 695MB mcr.microsoft.com/dotnet/core/aspnet 3.0-buster-slim 1d97a08ada5a 4 days ago 207MB mcr.microsoft.com/dotnet/core/sdk <none> 4e9e8dec2900 3 weeks ago 707MB mcr.microsoft.com/dotnet/core/aspnet <none> de4e4dcb9041 3 weeks ago 196MB mcr.microsoft.com/dotnet/core/sdk 2.2 e268893be733 4 months ago 1.74GB mcr.microsoft.com/dotnet/core/sdk 2.2-stretch e268893be733 4 months ago 1.74GB mcr.microsoft.com/dotnet/core/aspnet 2.2-stretch-slim cb2dd04458bc 4 months ago 260MB microsoft/dotnet 2.1-aspnetcore-runtime a5f99632e68d 4 months ago 253MB mcr.microsoft.com/dotnet/core/aspnet 2.2 df2a085ca3a8 4 months ago 260MB In order to update the container and make sure they are the latest version, I ran pull: PS C:\WINDOWS\system32> docker pull mcr.microsoft.com/dotnet/core/sdk:2.2 2.2: Pulling from dotnet/core/sdk 9cc2ad81d40d: Pull complete e6cb98e32a52: Pull complete ae1b8d879bad: Pull complete 42cfa3699b05: Pull complete dcc190332ff6: Pull complete b49aea48d777: Pull complete 67e832fd5d6a: Pull complete Digest: sha256:e1b19d391986f21b177c1ba47f8a8519bf5cff66a9459d04f3aea23e1a7ec30f Status: Downloaded newer image for mcr.microsoft.com/dotnet/core/sdk:2.2 mcr.microsoft.com/dotnet/core/sdk:2.2 Now I have an update container for version 2.2 of the DotNet Core SDK PS C:\WINDOWS\system32> docker images | findstr "dotnet" mcr.microsoft.com/dotnet/core/sdk 2.2 08657316a4cd 4 days ago 1.74GB This will update the container that is located locally and if you were having any problems simply restart any container that uses that particular container to gain the latest version. The concludes the update of the container.

Can’t run dotnet in Windows Subsystem for Linux (WSL)


Having installed Bash on Ubuntu on your Windows 10 computer, your now looking to create a new application using .NET Core.You start up a windows command prompt and run the bash command or directly run the Ubuntu command from your Windows menu. Once it is up and running you type in dotnet to create a new project and you receive this.As you can see from the image it says that command not found, this will not work but the problem isn’t that the command doesn’t exists unless the .NET Core SDK is not installed, but that in linux you need to add the .exe extension to your command. If we type in dotnet.exe we will receive the following instead:Now that we have figured out how to launch dotnet in WSL we can continue to develop our application using this framework.

Running Bash on Ubuntu on Windows 10


During the //Build 2016 conference, Microsoft announced that the Bash shell and other GNU/Linux command line tools would soon be able to directly run on the Windows platform natively.  I think as people start to use this and get familiar with Bash it will help people moving from the Linux world or people who want to get familiar with the Bash shell. I have used the shell on Linux and am somewhat familiar with it but most of my time has been spent in the Windows world developing with that platform. Therefore preventing me from really using it to it’s potential. I am interested now that it is available to start playing with it and see how it works on the window platform. Gabe Aul announced the release of Windows 10 build #14316 to the Windows Insider Fast-Ring. This is the first build of Windows 10 that offers the Windows Subsystem for Linux. One of the pieces needed to run Bash on Ubuntu on Windows. How to get Bash on Ubuntu on Windows installed After you have the updated to the new build, there are some steps that need to be completed to get this up and running. Installation Turn on Developer ModeOpen Settings –> Update and Security –> For Developers –> Select the Developer Mode radio button Enable the Windows Subsystem for Linux (beta)Search for “Turn Windows features on and off”Scroll down and make sure that the “Windows Subsystem for Linux (Beta)” feature is selected.Click OK and reboot (this is required to allow the next step).Another option is to use PowerShell- Open a PowerShell prompt as administrator and run: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Open a command prompt and run “bash” and follow the instructions. Once the installation completes you will be able to run bash from the command prompt or use the shortcut in the Start Menu. Enjoy and check out what is possible with this new addition to our Windows environment.