secretAgentB
secretAgentB

Reputation: 1279

Deploying dotnet core app in non-cloud environment with docker

I have been watching videos on youtube about docker and how they work. I get the concept and I really like it. But I am not liking the idea of including my source code into the container due to the nature of the environment our code gets deployed into and some other mandated restrictions. By the way here is the link to the video

https://youtu.be/vp-mlvn_7tA

A couple of questions popped in my head while watching the video;

  1. Is it possible to use docker without including the source code into the image? Maybe just copy the bin file into the image and do dotnet run within and still maintain a small docker image file?

  2. Our clients are not in a cloud platform and is currently in a closed network for security purposes. Can I still deploy docker containers to them without having to connect to a repository? Like from an installer in a media (CD/USB)?

  3. Our application is a microservice app that is written in .NET Core 2.1. Do we need to have to put each services into a container of their own?

Upvotes: 0

Views: 80

Answers (2)

dotnetstep
dotnetstep

Reputation: 17485

  • It is completely possible to create image without including source code into it. Here there are two type of things you can do.

    1. Publish your api or webapp locally and then create image out of that particular published file.
    2. Create Multi-Stage Image. Here still your source code build into image but it is intermediate image.
  • For registry there are following type.

    1. Public
    2. Private
    3. On-Premise or Local.

      • some of the above option like dockerhub only allow single image as private for free account.
      • You can create your own local repository.
  • That is up to you but it is great to have separate image and container for each web api. Lets assume in your case that you have two api that almost run together then you can deploy both. ( Even docker allow to expose multiple port so you don't have to worry)

Upvotes: 1

D. Vinson
D. Vinson

Reputation: 1158

  1. Depends on your app, but should be possible.

  2. You can create a local registry to store your images.

  3. Each service should run in it's own container.

Upvotes: 0

Related Questions