Back to questions
JuniorTheoryVery common
What does the last command print?
docker run -d --name web nginx:1.27.3
docker exec web sh -c 'echo hi > /tmp/note.txt'
docker rm -f web
docker run -d --name web nginx:1.27.3
docker exec web cat /tmp/note.txtAn error: there is no /tmp/note.txt in the new container
- Expecting files written in a container to survive
docker rmwithout a volume - Thinking a new container with the same name is the old one restarted
- Which change to the commands keeps
/tmp/note.txtacrossdocker rm? - Would the file survive
docker stopanddocker startinstead ofdocker rm?