Skip to content
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

Docker support #72

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Docker support #72

wants to merge 18 commits into from

Conversation

Viktor45
Copy link

Added simple dockerfile and manual line

Added simple dockerfile and manual line
Dockerfile Outdated
linux-headers \
musl-dev

RUN git clone https://github.com/hufrea/byedpi /opt/byedpi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for cloning the repo, because we already have it with Dockerfile. So, COPY . /opt/byedpi.

Copy link
Author

@Viktor45 Viktor45 Aug 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for cloning the repo, because we already have it with Dockerfile. So, COPY . /opt/byedpi.

Sometimes users just downloads one Dockerfile at all, instead of full repo. I think Dockerfile can be self-contained, no need to download all repository code to operating systems that don't have git installed, you might not even have a compiler on the host

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, fetching specified version always better than fetching latest master

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, fetching specified version always better than fetching latest master

Great advice, thanks! Fixed to latest release code.

Dockerfile Outdated
build-base \
curl \
git \
libpcap-dev \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what?

Copy link
Author

@Viktor45 Viktor45 Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what?

Ok, Removed unnecessary dependencies

build-base + linux headers = build tools + linux/tcp.h
curl + git = getting latest github release code from releases only, not master

README.md Outdated

```sh
docker build ./ -t byedpi:latest
docker run -p 1080:1080 -ti byedpi:latest ciadpi --disorder 1 --split 1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split is meaningless in the same position as disorder (it won't send anything).

@hufrea
Copy link
Owner

hufrea commented Sep 13, 2024

I think this should be moved to dist/

Update as requested
@Viktor45
Copy link
Author

I think this should be moved to dist/

moved


```sh
docker build ./ -t byedpi:latest
docker run -p 1080:1080 -ti byedpi:latest ciadpi --disorder 1 --auto=torst --tlsrec 1+s

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add debug logs for docker:
--disorder 1 --auto=torst --tlsrec 1+s --debug 1

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add debug logs

This is just an example! You need to make your parameters yourself!

dist/Dockerfile Outdated
curl \
git \
linux-headers && \
git clone -b \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better split git clone and apk add, see https://github.com/tazihad/byedpi-docker/blob/main/Dockerfile

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@Saiv46
Copy link

Saiv46 commented Oct 12, 2024

@hufrea Any progress?

@inizovtsev
Copy link

Guys, did you have any issues running the app inside docker? I tried to do it on mac os using Docker Desktop for Mac with the following dockerfile:

FROM alpine:latest

ARG version=v0.14.1
ARG filename=byedpi-14.1-x86_64.tar.gz

WORKDIR /app

RUN \
    wget https://github.com/hufrea/byedpi/releases/download/${version}/${filename} \
    && tar xzf ${filename}

EXPOSE 1080

CMD ["./ciadpi-x86_64", "--oob", "3"]

and when I built it and ran it (docker run --rm -P -p 0.0.0.0:1080:1080 byedpi:latest) I got the following error in Firefox:

Secure Connection Failed

An error occurred during a connection to www.google.com. Peer received an SSL record that was longer than is permitted.

Error code: SSL_ERROR_RECORD_OVERFLOW_ALERT

This option works perfect for byedpi directly running on mac os (I built it natively) but it does not work inside docker for mac. I think it can be related to docker network layer (I guess it somehow fragments tcp packets or so) but I have no proofs. Other options like --fake did not cause this error but youtube did not work with them on my ISP.

If I'm right and docker network layer (at least for bridge network) is reason for this error then there are some limitations for dockerizing the app.

@Viktor45
Copy link
Author

any issues

use issues instead, dont mix -P and -p options.

@inizovtsev
Copy link

inizovtsev commented Oct 15, 2024

dont mix -P and -p options.

It happens in any case so looks like it does not matter for docker.

use issues instead

I'll recheck it after the PR is merged and then will create an issue.

[UPDATE]: checked it on vps with ubuntu and did not face with the issue. So it most likely related to docker desktop for mac (I guess due to hypervisor). Wireshark shows there is no tcp packet with URG flag in that case, so tcp data is malformed somehow.

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.

7 participants