Skip to content

Commit

Permalink
Add Dockerfile for build
Browse files Browse the repository at this point in the history
To enable building for other distributions or without
installing the build dependencies locally, provide a
Dockerfile and the corresponding usage guide.

Signed-off-by: Florian Kauer <[email protected]>
  • Loading branch information
koalo committed Jan 9, 2024
1 parent 1a95055 commit 93234db
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,16 @@ tail /var/log/detd.log
At this point the service is ready to receive requests.


#### Docker

To avoid installing all build dependencies locally, you can also use Docker for building the Debian package:

```
docker build -f tools/Dockerfile . -t detd_builder
docker run --name detd_build_container detd_builder
docker cp detd_build_container:/tmp/detd_0.1.dev0-1_all.deb ./
docker rm detd_build_container
```

#### pip

Expand Down
22 changes: 22 additions & 0 deletions tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update --fix-missing && \
apt-get upgrade --assume-yes --no-install-recommends && \
apt-get install --assume-yes --no-install-recommends \
debmake debhelper-compat dh-python \
python3 python3-all python3-setuptools \
protobuf-compiler python3-protobuf && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

ADD . /usr/local/src/detd/

WORKDIR /usr/local/src/detd/tools

# Work around bug in debmake
RUN ln -s /usr/lib/debmake/python3.short /usr/lib/debmakepython3.short
RUN ln -s /usr/lib/debmake/python3.long /usr/lib/debmakepython3.long

CMD ./package_debian.sh

0 comments on commit 93234db

Please sign in to comment.