Docker Community Forums

Share and learn in the Docker community.

Deploy .NET Core Console Application

I have built an .NET Core Console Application, and with .NET Core Docker Support, after i installed docker for window, and i successfully build the image of my Console App and able to run the container with the image in local laptop.

My question is, beside of upload my container to Azure or Docker Hub.

Can i simply move my container from mine laptop, let say to another computer or laptop?

I new to docker, hope can get any guide.

If I understood correctly, Yes you can. when you run “docker login” it automatically login to docker.io buy you’re able to change it to what hub you want to change as “docker login localhost:8080”. Afterward, you can push all your images on your laptop to a remote hub.

On the other hand, docker allows you to extract the containers/images as a “.tar” file. You may want to check “docker save” and “docker load” functions.

Thanks for replied.

Noted of your information.

Further more my questions :-1:

I did having docker desktop installed on my laptop, and i done a simple .NET Core Console App, i did a docker file and docker images, and i build a container as well.

And i able docker run in my local laptop.

My next question.

Let say i have production server in Window OS.

  1. How i copy my container into that server?
  2. In my local laptop, as i successfully run my container, but where is the files located actually?
  3. What is the condition of production server? It need install docker engine too ? As later i will copy my container into that server?

If any of docker object such as image, container, network etc will run on any of server such as Linux, macOs, Windows, docker-engine must be installed on it.

the most known way to send the images that you’ve created to the dev/test/prod system is to push all the images to docker hub and pull them from your server. When you use Dockerfile that means that you made a box which has your published code in. Before deploy your image to your server you must push it to hub to allow your server can pull and make a container with it.

For debugging purposes, you can use the DLL file. You can run it using dotnet ConsoleApp2.dll. If you want to generate an EXE file, you have to generate a self-contained application.

To generate a self-contained application (EXE in Windows), you must specify the target runtime (which is specific to the operating system you target).

Pre-.NET Core 2.0 only: First, add the runtime identifier of the target runtimes in the .csproj file (list of supported RIDs):

win10-x64;ubuntu.16.10-x64 The above step is no longer required starting with .NET Core 2.0.

Then, set the desired runtime when you publish your application:

dotnet publish -c Release -r win10-x64
dotnet publish -c Release -r ubuntu.16.10-x64

Thanks for replied and noted on the useful informations.

Thank you. Where should I use this line: ‘docker login localhost:8080’ ?
I’m new to docker, sorry for the silly question.

Regards, Eugene
My FaceBook: https://www.facebook.com/eugene.scott.712161
My Web site: https://coffee-statistics.com/