-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: use slim and add multiple layers
reduces the image's size with over 80%
- Loading branch information
1 parent
1f1da24
commit 929425a
Showing
1 changed file
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
|