Docker-compose.yml isolation : hyperv

Hi everyone,

I have a problem with isolation: hyperv tag in the docker composition file.
I tried to add this tag to my yml file but it looks like it is not working properly.
When I tried to create the image, the message “Different kernel version error” is displayed.
Can anyone help me figure out where I’m wrong?

Here’s an extrackt of my file:

version: ‘3.7’

services:

#ServiceOne

ServiceOne:
    env_file:
      - ./Env/WCF_COMMUNICATION.env
    image: btsrwebservicewcf
    isolation: hyperv
    build:
      context: \pub\ServiceOne
      dockerfile: Dockerfile        
    restart: always  

Thank you in advance.

Make sure the Hyper-V role is installed on your host:
https://hub.docker.com/_/microsoft-windows-servercore

Configuration

  • Your host must have the Windows container feature enabled. The Windows container feature is only available on Windows Server 2016 (Core and with Desktop Experience), Windows 10 Professional and Enterprise (Anniversary Edition) and later.
  • If you intend to run the container with Hyper-V isolation, The Hyper-V role must be installed on the host first.