br4chu / docker-compose-maven-plugin

Maven plugin that talks to docker-compose command-line interface
Apache License 2.0
12 stars 4 forks source link

Network support in docker compose #8

Closed italktothewind closed 4 years ago

italktothewind commented 4 years ago

I want to report that the following compose is not working (works without the network):

version: '2.1'

services:

  mydb:
    hostname: mydb
    mac_address: 02:42:ac:11:65:43 
    image: mysql:5.7.31
    environment:
      MYSQL_ROOT_PASSWORD: myrootpass
      MYSQL_DATABASE: mydb
      MYSQL_USER: myuser
      MYSQL_PASSWORD: mypass
    ports:
      - "3308:3306"
    volumes:
      - ./mysql:/docker-entrypoint-initdb.d
    networks:
      mynet:
        ipv4_address: 10.5.0.11

networks:
    mynet:
        ipam:
            driver: default
            config:
                 - subnet: 10.5.0.0/24
italktothewind commented 4 years ago

Issue was occurring due to a previously created network with the same name.