I'm also now realizing that it probably would be appropriate to have created a volume for the /home/vagrant directory so that data there persists between sessions. That would generally look like: In `build-docker.sh`: ``` docker volume create searchfox-vol ``` As an extra line to the `docker run` invocation in `run-docker.sh`: ``` --mount source=${VOLUME_NAME},target=/home/vagrant \ ``` and obviously above that, defining a helper var: ``` VOLUME_NAME=${SEARCHFOX_DOCKER_VOLUME_NAME:-searchfox-vol} ``` The mount command will automatically copy the contents of /home/vagrant into the new volume, so it's not necessary to re-provision the VM. That said, it would be necessary to invoke `docker rm searchfox` in order to cause run-docker.sh to realize it needs to re-create the container.
Bug 1812838 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I'm also now realizing that it probably would be appropriate to have created a volume for the /home/vagrant directory so that data there persists between sessions. That would generally look like: In `build-docker.sh`: ``` docker volume create searchfox-vol ``` As an extra line to the `docker run` invocation in `run-docker.sh`: ``` --mount source=${VOLUME_NAME},target=/home/vagrant \ ``` and obviously above that, defining a helper var: ``` VOLUME_NAME=${SEARCHFOX_DOCKER_VOLUME_NAME:-searchfox-vol} ``` The mount command will automatically copy the contents of /home/vagrant into the new volume, so it's not necessary to re-provision the VM. That said, it would be necessary to invoke `docker rm searchfox` in order to cause run-docker.sh to realize it needs to re-create the container. (And therefore it could also be reasonable to call `docker rm ${CONTAINER_NAME}` at the bottom of `build-docker.sh` too, so that attempts to re-provision will automatically take effect on the next call to `run-docker.sh`. Note that this does assume that `CONTAINER_NAME=${SEARCHFOX_DOCKER_CONTAINER_NAME:-searchfox}` is added to `build-docker.sh` as well or things refactored to source a file containing the now-shared stanza.)