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 16:04:44 +05:00
|
|
|
RUN rm -rfv Cargo.lock Cargo.toml rust src rustup .cargo target .rustup \
|
|
|
|
/usr/share/perl \
|
|
|
|
/usr/share/zoneinfo \
|
|
|
|
/usr/bin/perl5.28.1 \
|
|
|
|
/usr/bin/perl \
|
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
/var/lib/dpkg/info/* \
|
|
|
|
/var/cache/* \
|
|
|
|
/var/log/*
|
|
|
|
# /lib/x86_64-linux-gnu/libc-2.28.so \
|
|
|
|
# /lib/x86_64-linux-gnu/libm-2.28.so
|
|
|
|
# /usr/lib/gcc \
|
|
|
|
# /usr/lib/x86_64-linux-gnu \
|
|
|
|
|
2022-09-24 04:22:23 +05:00
|
|
|
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"]
|