Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

run linux containers on windows server 2019

I'm trying to run Redis and ElasticSearch containers on windows server 2019. But I get error.

Here is my docker compose :

version: '3.7'

services:

  redis:
    image: redis:alpine
    command: redis-server --appendonly yes
    command: redis-server --requirepass 1234Abcd?!
    ports:
     - "6339:6379"
    volumes:
      - /volumes/redis/data:/data
    networks:
     - marketland 

  elasticsearch:
   image: elasticsearch:7.6.2
   volumes:
     - /volumes/elastic/data:/usr/share/elasticsearch/data
   volumes:
      - "esdata:/usr/share/elasticsearch/data"
   hostname: elasticsearch
   ports:
     - "9200:9200"
   environment:
     - discovery.type=single-node
     - bootstrap.memory_lock=true
   ulimits:
      memlock:
        soft: -1
        hard: -1
   networks:
     - marketland
     
  kibana:
   image: kibana:7.6.2
   ports:
     - "5601:5601"
   depends_on:
      - elasticsearch
   environment:
     - ELASTICSEARCH_HOSTS=http://elasticsearch:9200
     - SERVER_NAME=kibana
   networks:
     - marketland
networks:
  marketland:
    external: true
volumes:
  esdata:

and after execute docker-compose -f docker-compose-pre up, I get this error :

Creating services_redis_1 ...
Creating services_elasticsearch_1 ... error
Creating services_redis_1         ... error
ERROR: for services_elasticsearch_1  Cannot create container for service elasticsearch: invalid option: Windows does not support Ulimits

ERROR: for services_redis_1  Cannot create container for service redis: failed to start service utility VM (createreadwrite): hcsshim::CreateComputeSystem 6821998c02d7861bd5fd6ca679dedcf30f9de574485632daed57d8fc872ae323_svm: The virtual machine could not be started because a required feature is not installed.
(extra info: {"SystemType":"container","Name":"6821998c02d7861bd5fd6ca679dedcf30f9de574485632daed57d8fc872ae323_svm","Layers":null,"HvPartition":true,"HvRuntime":{"ImagePath":"C:\\Program Files\\Linux Containers","LinuxInitrdFile":"initrd.img","LinuxKernelFile":"kernel"},"ContainerType":"linux","TerminateOnLastHandleClosed":true})

ERROR: for elasticsearch  Cannot create container for service elasticsearch: invalid option: Windows does not support Ulimits

ERROR: for redis  Cannot create container for service redis: failed to start service utility VM (createreadwrite): hcsshim::CreateComputeSystem 6821998c02d7861bd5fd6ca679dedcf30f9de574485632daed57d8fc872ae323_svm: The virtual machine could not be started because a required feature is not installed.
(extra info: {"SystemType":"container","Name":"6821998c02d7861bd5fd6ca679dedcf30f9de574485632daed57d8fc872ae323_svm","Layers":null,"HvPartition":true,"HvRuntime":{"ImagePath":"C:\\Program Files\\Linux Containers","LinuxInitrdFile":"initrd.img","LinuxKernelFile":"kernel"},"ContainerType":"linux","TerminateOnLastHandleClosed":true})
ERROR: Encountered errors while bringing up the project.

Is there any way to run these containers on Windows Server 2019 ?

** Hyper-v has already enabled.

like image 846
Arsalan Valoojerdi Avatar asked Jan 23 '26 08:01

Arsalan Valoojerdi


1 Answers

You cannot set ulimit in windows. Remove below lines:

ulimits:
      memlock:
        soft: -1
        hard: -1

It will only solve your elasticsearch problem. I recommend to try to use docker on linux.

like image 159
hamid bayat Avatar answered Jan 25 '26 15:01

hamid bayat