avast / gradle-docker-compose-plugin

Simplifies usage of Docker Compose for integration testing in Gradle environment.
MIT License
413 stars 96 forks source link

Volume is not deleted #434

Open hammer-abcfitness opened 10 months ago

hammer-abcfitness commented 10 months ago

Using this with mysql/maria:

plugins {
        id 'com.avast.gradle.docker-compose' version '0.17.6'
}

dockerCompose.isRequiredBy(test)

dockerCompose {
    startedServices = ['db']
}

With a compose file with mariadb

version: '3.3'
services:
  db:
    platform: linux/x86_64
    image: mariadb:10.5.8
    profiles: ["all", "dev"]
    container_name: footest-service-database-os
    restart: always
    environment:
      MYSQL_DATABASE: 'fooStuff_db'
      # So you don't have to use root, but you can if you like
      MYSQL_USER: 'user'
      # You can use whatever password you like
      MYSQL_PASSWORD: 'password'
      # Password for root access
      MYSQL_ROOT_PASSWORD: 'password'
    ports:
      # This maps your mysql instance to port 3306 on your local machine.
      # You may need to change this if you have the port in use.
      # <Port exposed> : <MySQL Port running inside container>
      - '3306:3306'
    expose:
      # Opens port 3306 on the container
      - '3306'
      # Where our data will be persisted
    volumes:
      - my-db:/var/lib/mysql

# Names our volume
volumes:
  my-db:

The containers are deleted, however, the volume is not.

This may be the same issue as #369