Skip to content

Commit

Permalink
docker: use slim and add multiple layers
Browse files Browse the repository at this point in the history
reduces the image's size with over 80%
  • Loading branch information
razvancrainea committed Aug 22, 2024
1 parent 1f1da24 commit 929425a
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
FROM python:3.12-bookworm
LABEL maintainer="darius.stefan@opensips.org"

RUN apt update && apt install -y tcpdump &&\
pip install --upgrade pip &&\
pip install pyyaml &&\
git clone https://github.com/OpenSIPS/SIPssert.git &&\
FROM python:3.12-slim-bookworm AS build

RUN apt update && apt install -y git

WORKDIR /usr/src
RUN git clone https://github.com/OpenSIPS/SIPssert.git &&\
cd SIPssert &&\
python3 setup.py install &&\
cd ..
python3 setup.py install

FROM python:3.12-slim-bookworm AS sipssert

RUN apt update && apt install -y tcpdump

COPY --from=build /usr/local/bin/sipssert /usr/local/bin/sipssert
COPY --from=build /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages

ENTRYPOINT ["sipssert"]

0 comments on commit 929425a

Please sign in to comment.