diff --git a/.gitignore b/.gitignore index 9ac76d8fac..66e1db0246 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,4 @@ target/ src/ .gclient_entries +.gclient_previous_sync_commits diff --git a/Makefile b/Makefile index 70e88127ad..1e3a147cab 100644 --- a/Makefile +++ b/Makefile @@ -20,13 +20,13 @@ 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) @@ -34,7 +34,7 @@ sync: 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) \ diff --git a/README.md b/README.md index 9529ed53f7..a2c519353b 100644 --- a/README.md +++ b/README.md @@ -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:" + ENV HTTPS_PROXY "http://127.0.0.1:" + ``` + + 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. diff --git a/dockers/Dockerfile.compile b/dockers/Dockerfile.compile index e207f3339c..3ce7c4a39a 100644 --- a/dockers/Dockerfile.compile +++ b/dockers/Dockerfile.compile @@ -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}"