-
-
Notifications
You must be signed in to change notification settings - Fork 181
/
Dockerfile
33 lines (31 loc) · 873 Bytes
/
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
FROM alpine:latest AS build
RUN apk add autoconf automake libtool \
libevent-dev libxml2-dev jansson-dev \
readline-dev libcap-dev bsd-compat-headers \
alpine-sdk
WORKDIR /build
COPY . .
RUN ./autogen.sh
RUN ./configure \
--prefix=/usr/local \
--sysconfdir=/etc \
--enable-pie \
--enable-hardening \
--without-embedded-libevent \
--without-snmp \
--with-xml \
--with-privsep-user=_lldpd \
--with-privsep-group=_lldpd \
--with-privsep-chroot=/run/lldpd \
--with-lldpd-ctl-socket=/run/lldpd.socket \
--with-lldpd-pid-file=/run/lldpd.pid
RUN make
RUN make install DESTDIR=/lldpd
FROM alpine:latest
RUN apk add libevent libxml2 jansson readline libcap \
&& addgroup -S _lldpd \
&& adduser -S -G _lldpd -D -H -g "lldpd user" _lldpd
COPY --from=build /lldpd /
VOLUME /etc/lldpd.d
ENTRYPOINT ["lldpd", "-d"]
CMD []