mirror of
https://github.com/uditkarode/bml-proxy.git
synced 2025-02-23 09:42:12 +00:00
added multistage build
This commit is contained in:
parent
0ad15b913c
commit
66ce95adaa
47
Dockerfile
47
Dockerfile
@ -1,44 +1,21 @@
|
|||||||
FROM lwthiker/curl-impersonate
|
FROM rust:slim-bullseye AS build
|
||||||
|
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
#backup
|
RUN apt-get update \
|
||||||
RUN cp -v .bashrc bashrc && cp .profile profile
|
&& apt-get install -y pkg-config \
|
||||||
|
build-essential \
|
||||||
|
openssl \
|
||||||
|
libssl-dev
|
||||||
|
|
||||||
# required stuff for compiling
|
RUN cargo build --release
|
||||||
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
|
|
||||||
|
|
||||||
# Compile
|
FROM lwthiker/curl-impersonate:latest
|
||||||
RUN /root/.cargo/bin/cargo build --release
|
|
||||||
|
|
||||||
# move bin to working dir
|
WORKDIR /root
|
||||||
RUN mv /root/target/release/bml_proxy .
|
COPY --from=build /root/target/release/bml_proxy /root/
|
||||||
|
|
||||||
## Clean up
|
ENV LD_PRELOAD="/usr/local/lib/libcurl-impersonate-chrome.so"
|
||||||
RUN apt purge curl build-essential libssl-dev pkg-config cargo -y
|
|
||||||
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 \
|
|
||||||
|
|
||||||
RUN cp -v bashrc .bashrc && cp -v profile .profile
|
CMD /root/bml_proxy
|
||||||
|
|
||||||
#default variable
|
|
||||||
ENV LD_PRELOAD=/root/libs/libcurl-impersonate-chrome.so
|
|
||||||
|
|
||||||
# start service
|
|
||||||
CMD ["./bml_proxy"]
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user