Skip to content

Commit 3d6d9cc

Browse files
authored
Merge pull request #48 from aojea/dockerfile
use neper in a container image
2 parents a9b58eb + 2ae2467 commit 3d6d9cc

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM debian:12
2+
WORKDIR /src
3+
RUN apt-get update && apt-get install build-essential -y
4+
COPY . .
5+
RUN make clean && make all
6+
7+
# debug images contain a busybox shell
8+
FROM gcr.io/distroless/cc-debian12:debug
9+
WORKDIR /home
10+
COPY --from=0 /src/tcp_rr /bin/tcp_rr
11+
COPY --from=0 /src/tcp_stream /bin/tcp_stream
12+
COPY --from=0 /src/tcp_crr /bin/tcp_crr
13+
COPY --from=0 /src/udp_rr /bin/udp_rr
14+
COPY --from=0 /src/udp_stream /bin/udp_stream
15+
COPY --from=0 /src/psp_stream /bin/psp_stream
16+
COPY --from=0 /src/psp_crr /bin/psp_crr
17+
COPY --from=0 /src/psp_rr /bin/psp_rr
18+
# useful to deploy the image as a Kubernetes Pod
19+
# as it keeps the image running forever
20+
ENTRYPOINT [ "/busybox/sleep", "infinity" ]

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,9 @@ binaries: tcp_rr tcp_stream tcp_crr udp_rr udp_stream psp_stream psp_crr psp_rr
9292

9393
clean:
9494
rm -f *.o tcp_rr tcp_stream tcp_crr udp_rr udp_stream psp_stream psp_crr psp_rr
95+
96+
IMAGE ?= neper
97+
TAG ?= $(shell git describe --tags --always --dirty)
98+
99+
image:
100+
docker build --tag ${IMAGE}:${TAG} .

0 commit comments

Comments
 (0)