Found it difficult to find the right Docker setup for magento 2.4 for Windows 10. So I had to setup my own Docker file. I don't have that much experience with Docker but here's a working setup to get startet.

First: Install the Magento using CLI

composer create-project --repository=https://repo.magento.com/ magento/project-community-edition ./
Install Magento via. CLI

Add a docker-compose.yml file in main directory. I created an application folder where magento is going to be installed.

version: "3.8"

services:
### Nginx #########################################
  nginx:
    image: library/nginx:latest
    container_name: nginx
    working_dir: /application
    volumes:
      - ./application:/application
      - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
      - ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
    ports:
      - "80:80"
    networks:
      - application

### PHP #########################################
  php-fpm:
    build: docker/php-fpm/build
    container_name: php-fpm
    working_dir: /application
    tty: true
    expose:
      - 9000
    volumes:
      - ./application:/application
      - ./docker/php-fpm/php-ini-overrides.ini:/etc/php/7.4/fpm/conf.d/99-overrides.ini
      - ./docker/php-fpm/extra/root:/root
    extra_hosts:
      - "magento.test:192.168.65.2" 
    networks:
      - application

### Mysql #########################################
  db:
    image: library/mysql:latest
    restart: unless-stopped
    container_name: mysql-database-server
    tty: true
    volumes:
      - ./docker/mysql/data:/var/lib/mysql
      - ./docker/mysql/my.cnf:/etc/mysql/my.cnf
    environment:
      MYSQL_ROOT_PASSWORD: "secret"
      MYSQL_DATABASE: "database"
      MYSQL_USER: "user"
      MYSQL_PASSWORD: "password"
      MYSQL_ROOT_HOST: "%"
      DATA_PATH_HOST: ./docker/mysql/data
    expose:
      - 3306
    ports:
      - "3306:3306"
    networks:
      - application

### Elasticsearch #########################################
  elasticsearch:
    image: library/elasticsearch:7.8.1
    container_name: elastic-search
    ports:
      - "9200:9200"
      - "9300:9300"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    environment:
      - discovery.type=single-node
    networks:
      - application

### Redis #########################################
  redis:
    image: library/redis:latest
    container_name: redis
    ports:
      - "6379:6379"
    networks:
      - application

### RabbitMQ #########################################
  rabbitmq:
    image: library/rabbitmq:latest
    container_name: rabbitmq
    ports:
      - "5672:5672"
    networks:
      - application

networks:
  application:
    driver: bridge

volumes:
  source:
    driver: local
  docker:
    driver: local
Docker compose for Magento 2.4 

be aware that the solution above can be very slow on a Windows10. In order to make it (hopefully) more smooth try with docker-sync


Windows with Docker Desktop WSL 2:
The vm.max_map_count setting must be set in the docker-desktop container. (Guide)

$ wsl -d docker-desktop 
$ sysctl -w vm.max_map_count=262144