Set SHARKD_SOCKET to be usable by node user#24
Conversation
ekoyle
commented
Aug 29, 2023
- set SHARKD_SOCKET=/home/node/sharkd.sock in Dockerfile
- don't rm socket if it doesn't exist
- closes Docker example command broken #23
* set SHARKD_SOCKET=/home/node/sharkd.sock in Dockerfile * closes QXIP#23
| RUN cd / && tar zxvf /out/sharkd.tar.gz && rm -rf /out/sharkd.tar.gz | ||
|
|
||
| ENV CAPTURES_PATH=/captures/ | ||
| ENV SHARKD_SOCKET=/home/node/sharkd.sock |
There was a problem hiding this comment.
I've had a good degree of success placing the SHARKD_SOCKET within the CAPTURES_PATH since its pretty much guaranteed to be available, writeable and exclusive regardless of the container build or username. thoughts?
There was a problem hiding this comment.
I chose this one because it exists in the node:20-bookworm container we are building off of and is writable by the default node user that I set the docker container to run as. I am not opposed to putting it somewhere else.
I do have a concern with /captures/, as if that directory were shared between multiple instances, we could either delete a socket or use a sharkd instance that belongs to another container. We could also have problems in the unlikely event that /capture/ ends up on a mountpoint that doesn't support unix sockets (NFS, CIFS, FAT, NTFS, ...).