How to get Docker version in .NET Core

  .net-core, c#, docker, docker-compose

I am trying to determine the version of the docker in my .NET Core backend. I already had the idea to create an own environment variable in docker-compose, but I don’t know how to get the information like docker -v and pass it to the application when it starts.
I hope that one of you can give me a tip.

Part of the docker-compose

ports:
 - "5000:80"

environment:
  DOCKER_VERSION: ... docker -v ...

volumes:

Source: Docker Questions

LEAVE A COMMENT