Using docker volumes and by using the
--mount flag when you start your container.
A modified example from the Docker docs:
$ docker run -d \ --mount source=myvol2,target=/app \ nginx:latest
you just need to replace
nginx:latext with your image name and adapt
target as you need.
Another example (also from the docs) using
-v and mounting in read-only mode:
$ docker run -d \ -v nginx-vol:/usr/share/nginx/html:ro \ nginx:latest