Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker-compose --isolation=hyperv tag

I have to use the --isolation=hyperv configuration when I bringing up my container (using windows server 17.09).

for example:

 docker run -it -d -p 2222:80 --isolation=hyperv packagelocatorservice

I need to bring up 4 containers, so I am using docker-compose.yml file and the command docker-compose up

version: '3'

services:

web:
image: web
ports:
- 4444:80
build:
context: ./web/webapi
dockerfile: Dockerfile

uimetadataservice:
image: uimetadataservice
ports:
- 1111:80
build:
context: ./MetaDataService
dockerfile: Dockerfile

packagelocatorservice:
image: packagelocatorservice
ports:
- 2222:80
build:
context: ./PackageLocatorService/PackageLocatorService
dockerfile: Dockerfile

assetmanagementserviceweb:
image: assetmanagementserviceweb
ports:
- 3333:80
build:
context: ./InfrastructureWebService
dockerfile: Dockerfile

Any ideas if I can add the --isolation=hyperv tag inside the docker-compose file? Thanks.

like image 628
daniel the man Avatar asked Oct 28 '22 17:10

daniel the man


1 Answers

This commit may have added support for this: https://github.com/docker/compose/pull/5448/commits/8155ddc7add99edd1c9a366f44c65ba4d62589a3

I have updated the version to 3.5 and added isolation: 'hyperv' below images in web hope this works for you.

version: '3.5'

services:

web:
image: web
isolation: 'hyperv'
ports:
- 4444:80
build:
context: ./web/webapi
dockerfile: Dockerfile

uimetadataservice:
image: uimetadataservice
ports:
- 1111:80
build:
context: ./MetaDataService
dockerfile: Dockerfile

packagelocatorservice:
image: packagelocatorservice
ports:
- 2222:80
build:
context: ./PackageLocatorService/PackageLocatorService
dockerfile: Dockerfile

assetmanagementserviceweb:
image: assetmanagementserviceweb
ports:
- 3333:80
build:
context: ./InfrastructureWebService
dockerfile: Dockerfile

It's worth noting I was not able to mix and match different isolations

like image 163
Gravypower Avatar answered Dec 17 '22 09:12

Gravypower