I hava a senrio as follow: on basic.target stage. My host start running a serviceB, which create a unix socket file "/tmp/.test_sock" when service started. on the multi-user.target stage. The docker container "test_dc" starting created. what can i do, to create a volume in the docker test_dc, which is the mount of "/tmp/.test_sock"?
1 Answer
You can mount them as a regular volume, using -v on the CLI or volumes: in docker compose.
Here is an example: https://medium.com/@moaminsharifi/unix-sockets-in-a-docker-environment-a-comprehensive-guide-6b7588e5c2c4