testcontainers / testcontainers/testcontainers-java
[Enhancement]: Create volumes for testcontainers
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 8.7k
- Forks
- 1.9k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 9
Descripción
Module
Core
Proposal
I recently needed to create two test containers that shared data storage. One container would generate data, and the second would read this data. My first thought was to create a docker volume and share the volume in the two containers. This avoids bind mounts which complicates things greatly. Bind mounts are harder to make work cross platform and there are restrictions on bind mounts when I run in my CI tool, bitbucket pipelines.
However, I cannot find any way to do this with testcontainers. There is a way to use withVolumesFrom but there is no way to create the volume as best I can tell. Here is an example of what I was trying to do with test containers but shown with docker commands.
Create a first container with a annonymous volume:
docker run -it --rm --name source --volume=/share ubuntu bash
Create a second container that uses the same volume from the first:
docker run -it --rm --volumes-from source --name dest ubuntu bash
Then in the source container I write a file into the /share directory and I can cat it out in the dest container. I would like to set this up using test containers.
Thanks for this great tool!
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en el módulo Core rastreando la compatibilidad existente con withVolumesFrom y las APIs de configuración de contenedores. Compáralas con el comportamiento de volume y --volumes-from de Docker descrito en la issue. Se considera terminado cuando los usuarios pueden crear un volume y compartirlo entre dos contenedores de prueba, de modo que los datos escritos por uno puedan ser leídos por el otro.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- docker, java
- Área
- testing
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100