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

Fix: proxy & ninja issue #90

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@
target/
src/
.gclient_entries
.gclient_previous_sync_commits
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ gn_flags := --args='is_debug=false'
all: init sync app release

init:
docker build dockers --build-arg UID=$(shell id -u) --build-arg GUID=$(shell id -g) -f $(build_dockerfile) -t $(compile_docker)
docker build dockers --network host --build-arg UID=$(shell id -u) --build-arg GUID=$(shell id -g) -f $(build_dockerfile) -t $(compile_docker)

release:
docker build $(target_dir) -f $(release_dockerfile) -t $(release_docker)

sync:
docker run $(docker_flags) $(compile_docker) \
docker run --network host $(docker_flags) $(compile_docker) \
make docker-$@ \
output_dir=$(output_dir) \
gn_flags=$(gn_flags)

app: peerconnection_serverless

peerconnection_serverless:
docker run $(docker_flags) $(compile_docker) \
docker run --network host $(docker_flags) $(compile_docker) \
make docker-$@ \
output_dir=$(output_dir) \
target_lib_dir=$(target_lib_dir) \
Expand Down
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,22 @@ To compile AlphaRTC, please refer to the following steps

3. Build Docker images

``` shell
cd AlphaRTC
make all
```

You should then be able to see two Docker images, `alphartc` and `alphartc-compile` using `sudo docker images`
1. Change line 18, 19 of `AlphaRTC/dockers/Dockerfile.compile` to [your own proxy port](https://github.com/alanhg/others-note/issues/503)

```Dockerfile
# in `AlphaRTC/dockers/Dockerfile.compile`
ENV HTTP_PROXY "http://127.0.0.1:<your_proxy_port>"
ENV HTTPS_PROXY "http://127.0.0.1:<your_proxy_port>"
```

2. Compile AlphaRTC (about 10min+)

``` shell
cd AlphaRTC
make all
```

You should then be able to see two Docker images, `alphartc` and `alphartc-compile` using `sudo docker images`

### Option 2: Compile from Scratch
If you don't want to use Docker, or have other reasons to compile from scratch (e.g., you want a native Windows build), you may use this method.
Expand Down
4 changes: 4 additions & 0 deletions dockers/Dockerfile.compile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ RUN useradd ${USER} -l -u ${UID} -g ${GUID} -m -s /bin/bash || true
ARG DEPOT_TOOLS=/opt/depot_tools
ARG DOCKER_WORKDIR=/app/AlphaRTC/

ENV HTTP_PROXY "http://127.0.0.1:15777"
ENV HTTPS_PROXY "http://127.0.0.1:15777"

RUN apt install ninja-build
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ${DEPOT_TOOLS}
RUN chown ${USER} -R ${DEPOT_TOOLS}
ENV PATH="${DEPOT_TOOLS}/:${PATH}"
Expand Down