This repository has been archived by the owner on Dec 30, 2024. It is now read-only.
forked from ospalax/addon-kea-hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
109 lines (88 loc) · 2.59 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#
# Copyright (2019-2021) Petr Ospalý <[email protected]>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
ARG ALPINE_VERSION
FROM alpine:${ALPINE_VERSION} AS builder
ARG KEA_VERSION
ARG KEA_INSTALLPREFIX
ARG MAKE_JOBS
ARG KEEP_BUILDBLOB
ARG KEEP_BUILDDEPS
ARG INSTALL_HOOKS
ARG USE_DISTRO_PACKAGE
ENV KEA_VERSION "${KEA_VERSION}"
ENV KEA_INSTALLPREFIX "${KEA_INSTALLPREFIX}"
ENV MAKE_JOBS "${MAKE_JOBS}"
ENV KEEP_BUILDBLOB "${KEEP_BUILDBLOB}"
ENV KEEP_BUILDDEPS "${KEEP_BUILDDEPS}"
ENV INSTALL_HOOKS "${INSTALL_HOOKS}"
ENV USE_DISTRO_PACKAGE "${USE_DISTRO_PACKAGE}"
#
# build and install ISC Kea
#
# build script
WORKDIR /ikea
COPY build.sh ./
RUN chmod 0755 build.sh
# first stage: suite
RUN env KEEP_BUILDDEPS=yes ./build.sh suite
# second stage: hooks
COPY abuild.conf /
COPY src/hooks/ ./hooks/
# bug #2608 in kea 2.2.0, remove when fixed
COPY src/_missing_file/cfg_globals.h ./cfg_globals.h
RUN ./build.sh hooks
###############################################################################
# final image
###############################################################################
ARG ALPINE_VERSION
FROM alpine:${ALPINE_VERSION}
LABEL maintainer="Petr Ospalý (osp) <[email protected]>"
ARG KEA_VERSION
ARG KEA_INSTALLPREFIX
ARG USE_DISTRO_PACKAGE
ENV KEA_VERSION "${KEA_VERSION}"
RUN \
apk update \
&& \
apk add --no-cache \
boost \
postgresql-client \
mariadb-client \
mariadb-connector-c \
cassandra-cpp-driver \
openssl \
ca-certificates \
curl \
xz \
python3 \
&& { \
apk add --no-cache log4cplus \
|| \
apk add --no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
log4cplus \
; \
} \
&& { \
_use_distro_package=$(echo "${USE_DISTRO_PACKAGE}" | \
tr '[:upper:]' '[:lower:]') ; \
if [ "$_use_distro_package" = "yes" ] ; then \
apk add --no-cache "kea~${KEA_VERSION}" ; \
fi ; \
} \
&& \
rm -rf /var/cache/apk/*
# install build artifact
COPY --from=builder "${KEA_INSTALLPREFIX}" "${KEA_INSTALLPREFIX}"
COPY --from=builder /etc/ld-musl-* /etc/
# save alpine packages
COPY --from=builder /packages/ /packages/
RUN test -e "${KEA_INSTALLPREFIX}/lib" && ldconfig "${KEA_INSTALLPREFIX}/lib"
# run microservice
#ENTRYPOINT ["${KEA_INSTALLPREFIX}/sbin/kea-dhcp4"]
#CMD ["-c", "${KEA_INSTALLPREFIX}/etc/kea/kea-dhcp4.conf"]