title: How to assign static ip for docker containers (docker compose) in windows WSL2?
body: <p>I use docker compose to build up the services, i want to set the mysql to be static, i tried to use networks directive but it didn't work and the errors say the ip already occupied, every this i restart the windows, the mysql ip was changed, sometimes 172.18.0.3,or 172.18.0.4, anyone know how to assign a static ip to the container? here is the yml</p>
  <pre><code>version: '3.7'
  services:
    nginx:
      container_name: hki_nginx
      image: nginx:latest
      ports:
        - 80:80
        - 4433:443
      volumes:
        - ./nginx/nginx.conf:/etc/nginx/nginx.conf    
        - ./nginx/conf:/etc/nginx/conf.d
        - ./src:/var/www
      links:
        - php
        - php72
    php:
      container_name: hki_php
      image: php:5.6-fpm-ext1
      volumes:
        - ./src:/var/www
        - ./php/php.ini:/usr/local/etc/php/php.ini
        - ./php/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf
        #- ./php/phpfpm/:/usr/local/etc/php-fpm.d/
    php72:
      container_name: web_php
      image: php:7.2-fpm-ext2
      volumes:
        - ./src:/var/www
        - ./php72/php.ini:/usr/local/etc/php/php.ini
        - ./php72/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf
        #- ./php/phpfpm/:/usr/local/etc/php-fpm.d/      
    mysql:
      container_name: hki_mysql
      image: mysql:5.7
      volumes:
        - ./mysql/data:/var/lib/mysql
        - ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
        - ./mysql/init:/docker-entrypoint-initdb.d/
      ports: 
        - 3306:3306
      environment:
        - MYSQL_ROOT_PASSWORD=*Abcd1234
        - MYSQL_USER=abc
        - MYSQL_PASS=*Abcd1234
      #networks:
          #default:
              #ipv4_address: 172.18.0.3 
  </code></pre>