2022-09-24 03:47:01 +05:00
|
|
|
FROM lwthiker/curl-impersonate
|
|
|
|
|
|
|
|
WORKDIR /root
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2022-09-24 04:29:49 +05:00
|
|
|
#backup
|
2022-09-24 04:22:23 +05:00
|
|
|
RUN cp -v .bashrc bashrc && cp .profile profile
|
2022-09-24 04:29:49 +05:00
|
|
|
|
|
|
|
# required stuff for compiling
|
2022-09-24 03:47:01 +05:00
|
|
|
RUN apt update \
|
|
|
|
&& apt install curl build-essential libssl-dev pkg-config -y --no-install-recommends
|
|
|
|
RUN curl https://sh.rustup.rs -o rust \
|
|
|
|
&& sh rust -y
|
2022-09-24 04:27:39 +05:00
|
|
|
|
2022-09-24 04:29:49 +05:00
|
|
|
# Compile
|
|
|
|
RUN /root/.cargo/bin/cargo build --release
|
2022-09-24 03:47:01 +05:00
|
|
|
|
2022-09-24 04:29:49 +05:00
|
|
|
# move bin to working dir
|
2022-09-24 03:47:01 +05:00
|
|
|
RUN mv /root/target/release/bml_proxy .
|
2022-09-24 04:29:49 +05:00
|
|
|
|
|
|
|
## Clean up
|
2022-09-24 04:27:39 +05:00
|
|
|
RUN apt purge curl build-essential libssl-dev pkg-config cargo -y
|
2022-09-24 04:23:59 +05:00
|
|
|
RUN rm -rfv Cargo.lock Cargo.toml rust src Dockerfile \
|
2022-09-24 04:22:23 +05:00
|
|
|
docker-compose.yml rustup .cargo target .git .gitignore .rustup
|
|
|
|
RUN cp -v bashrc .bashrc && cp -v profile .profile
|
|
|
|
|
2022-09-24 04:29:49 +05:00
|
|
|
#default variable
|
2022-09-24 04:27:39 +05:00
|
|
|
ENV LD_PRELOAD=/root/libs/libcurl-impersonate-chrome.so
|
|
|
|
|
2022-09-24 04:29:49 +05:00
|
|
|
# start service
|
2022-09-24 03:47:01 +05:00
|
|
|
CMD ["./bml_proxy"]
|