0

Is there any support for ephemeral Docker volumes without relying on file systems like tmpfs?

On my use case the applications running on the containers need to write a lot of data and the Docker documentation recommends against the use of storage drivers for these scenarios, but because the containers will potentially be writing more than the total available RAM on the host, using tmpfs would involve having to increase the swap size and affecting the performance of other memory intensive operations.

So is there any other way to get a volume which contents get removed with the container?

An additional note is that the hypothetical solution would have to be configurable via docker-compose v2 as this is to be used with Rancher, which only supports docker-compose v1 and v2.

andresp
  • 1,624
  • 19
  • 31

1 Answers1

1

@andresp take a look at stack scoped volumes docs here, they exist while the stack/service are around. If you remove the stack the volume will get expunged. There is also a container scoped volume if you truly wanted the data to go away with each atomic container. Example of that here and here.

aemneina
  • 31
  • 5