Skip to content

Commit

Permalink
Consolidate Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
orgads committed Sep 15, 2024
1 parent d677f54 commit 30eca95
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 53 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,18 @@ and for now, it only works on Alpine Linux.

To build a static binary, pass `-DBUILD_STATIC=1` to cmake.

Two Alpine-based `Dockerfile`s are provided, which can be used as a
build-environment. Use either `Dockerfile` or `Dockerfile.full` in
the following commands:
An Alpine-based `Dockerfile` is provided, which can be used as a
build-environment. Build with the following commands:

```
git submodule update --init
docker build -t sipp -f docker/Dockerfile --output=. --target=bin .
```

Special arguments can be passed with `--build-arg`:
* `FULL=1` - build all optional components
* `DEBUG=1` - build with debug symbols

# Support

I try and be responsive to issues raised on Github, and there's [a
Expand Down
13 changes: 10 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

FROM alpine:3.20 AS build

ARG FULL=''

RUN apk add --no-cache \
binutils \
cmake \
Expand All @@ -16,21 +18,26 @@ RUN apk add --no-cache \
make \
ncurses-dev \
ncurses-static \
ninja
ninja \
${FULL:+linux-headers lksctp-tools-dev lksctp-tools-static openssl-dev openssl-libs-static}

WORKDIR /sipp
COPY CMakeLists.txt ./
COPY src src
COPY include include
COPY gtest gtest

ARG DEBUG=''
RUN --mount=type=bind,target=.git,source=.git \
git config --global --add safe.directory /sipp && \
cmake . -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_STATIC=1 \
-DUSE_PCAP=1 \
-DUSE_GSL=1 && \
ninja
-DUSE_GSL=1 \
${DEBUG:+-DDEBUG=1} \
${FULL:+-DUSE_SSL=1 -DUSE_SCTP=1} \
&& ninja

FROM scratch AS bin
COPY --from=build /sipp/sipp /sipp
Expand Down
47 changes: 0 additions & 47 deletions docker/Dockerfile.full

This file was deleted.

0 comments on commit 30eca95

Please sign in to comment.