diff --git a/Dockerfile b/Dockerfile index df2de00..112765b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,7 @@ COPY --from=intermediate /out /out 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 # RUN git clone --single-branch --branch master https://github.com/qxip/node-webshark /usr/src/node-webshark COPY --chown=node . /usr/src/node-webshark diff --git a/entrypoint.sh b/entrypoint.sh index 0ecfa64..9b3a452 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/bash # sharkd daemon fails to start if the socket already exists -rm "$SHARKD_SOCKET" +[ -f "$SHARKD_SOCKET" ] && rm "$SHARKD_SOCKET" exec npm start