Skip to content

Correct docker build #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Correct docker build #49

wants to merge 1 commit into from

Conversation

vaygr
Copy link

@vaygr vaygr commented Apr 17, 2025

This fixes 2 things:

  1. Pinned stable releases for wireshark and node-webshark. Cloning current branches for each doesn't guarantee successful build. This is the actual fix for Failed to build image using Dockerfile #47.
  2. Copying an empty directory as /usr/src/node-webshark. It must be copied from the intermediary image.

@CLAassistant
Copy link

CLAassistant commented Apr 17, 2025

CLA assistant check
All committers have signed the CLA.

@lmangani
Copy link
Member

Thanks this is appreciated! Unfortunately the node-webshark releases are far behind (devs fault) so we need to address that ahead of merging this and pin to a proper full featured and tested release if we want to pin. The current one would include old bugs.

@vaygr
Copy link
Author

vaygr commented Apr 17, 2025

@lmangani node-webshark is probably less critical, so I can adjust it to just wireshark. But if the release is expected fairly soon, addressing a broken build could wait a bit.

@CodeCommandoPants
Copy link

I was able to build by only pinning the wireshark version to v4.4.6 and keeping the old config done on line 10 and 40 original.

Example:

FROM node:20-bookworm as intermediate

RUN apt-get update && apt-get install -y \
	git sed wget unzip make python3 cmake flex bison libglib2.0-dev libgcrypt20-dev libspeex-dev libspeexdsp-dev libc-ares-dev \
	&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /out /usr/src /var/run
WORKDIR /usr/src

RUN git clone --depth=1 https://github.com/qxip/node-webshark.git /usr/src/node-webshark
RUN git clone --depth 1 --branch v4.4.6 https://gitlab.com/wireshark/wireshark.git /usr/src/wireshark

WORKDIR /usr/src/wireshark
RUN ../node-webshark/sharkd/build.sh

WORKDIR /usr/src
RUN mkdir web \
 && cd web \
 && wget github.com/qxip/webshark-ui/releases/latest/download/latest.zip \
 && unzip latest.zip \
 && rm -rf latest.zip \
 && sed -i 's|href="/"|href="/webshark/"|g' index.html


FROM node:20-bookworm-slim

RUN apt update \
    && apt install -y git libglib2.0-0 speex libspeex1 libspeexdsp1 libc-ares2 libxml2 \
    && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /captures /usr/local/bin /usr/local/share/wireshark/ \
    && chown -R node: /captures

COPY --from=intermediate /usr/src/wireshark/build/run/sharkd /usr/local/bin/sharkd
COPY --from=intermediate /usr/src/wireshark/build/run/colorfilters /usr/local/share/wireshark/colorfilters

ENV CAPTURES_PATH=/captures/
ENV SHARKD_SOCKET=/captures/sharkd.sock

COPY --chown=node . /usr/src/node-webshark
COPY --from=intermediate /usr/src/web /usr/src/node-webshark/web

VOLUME /captures

WORKDIR /usr/src/node-webshark/api
RUN npm install

EXPOSE 8085
ENTRYPOINT [ "/usr/src/node-webshark/entrypoint.sh" ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants