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

minimise image size #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM ubuntu:latest as builder

RUN mkdir -p /tmp/build /tmp/src
COPY *.h *.cpp *.h.in CMakeLists.txt /tmp/src/


RUN apt-get update && apt-get install -y g++ cmake make libcurl4-openssl-dev libxml2-dev libssl-dev && \
cd /tmp/build && cmake -DCMAKE_BUILD_TYPE=Release ../src && make install
cd /tmp/src && cmake -DCMAKE_BUILD_TYPE=Release . && make && \
make install DESTDIR=/tmp/build && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

FROM ubuntu:latest
RUN apt-get update && apt-get install -y libxml2 libcurl4
COPY --from=builder /tmp/build/SpeedTest /usr/local/bin
RUN apt-get update && apt-get install -y libxml2 libcurl4 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY --from=builder /tmp/build/ /

ENTRYPOINT ["/usr/local/bin/SpeedTest"]