feat: add build via docker

This commit is contained in:
Georg K
2023-01-06 02:30:39 +03:00
parent 03c59fec32
commit 731b58304c
6 changed files with 119 additions and 17 deletions

46
Dockerfile_build Normal file
View File

@@ -0,0 +1,46 @@
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
ARG RADIUS_TAG="v3.2.x"
ENV RADIUS_REPO="https://github.com/FreeRADIUS/freeradius-server.git"
ENV RADIUS_TAG=${RADIUS_TAG}
ENV RLM_RAW_REPO="https://github.com/jar3b/rlm_raw.git"
ENV RLM_RAW_TAG="master"
#
# Install build tools
#
COPY local-bionic.list /etc/apt/sources.list
RUN apt-get update && apt-get install -y devscripts equivs git quilt gcc
#
# Create build directory
#
RUN mkdir -p /usr/local/src/repositories
WORKDIR /usr/local/src/repositories
RUN git clone --depth 1 --single-branch --branch ${RADIUS_TAG} ${RADIUS_REPO}
RUN git clone --depth 1 --single-branch --branch ${RLM_RAW_TAG} ${RLM_RAW_REPO}
RUN mv rlm_raw/rlm_raw freeradius-server/src/modules
WORKDIR freeradius-server
#
# Install build dependencies
#
RUN git checkout ${RADIUS_TAG}; \
if [ -e ./debian/control.in ]; then \
debian/rules debian/control; \
fi; \
echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control
#
# Build the server
#
RUN make -j2 deb && ls -la ..
WORKDIR /usr/local/src/repositories
ADD upload.sh .
RUN chmod a+x upload.sh