Processes only get locally persistent storage
Why should containers work differently?
Containers are even worse by default
–
Enter container:
docker run -it --workdir /src ubuntu
Inside container:
touch file.txt
ls -l
exit
Look for file in new instance:
docker run -it --workdir /src ubuntu
It’s gone!
–
Enter container with bind mount:
docker run -it --volume $PWD:/src --workdir /src ubuntu
Create file:
touch file.txt
ls –l
exit
Look for file in new instance:
docker run -it --volume $PWD:/src --workdir /src ubuntu
It’s alive!
–
Hard problem even for green field
NFS shares are a good option
Docker storage plugins connect to storage backends