Skip to content

Commit 65c17ab

Browse files
committed
Update Dockerfile and run script for improved configuration handling
- Added installation of iproute2 and libsasl2-2 in the Dockerfile. - Updated the run script to streamline configuration sourcing and modified the path for the collector configuration file. - Changed the installation command to use the new install script location.
1 parent bd278ae commit 65c17ab

2 files changed

Lines changed: 11 additions & 22 deletions

File tree

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ RUN rm -rf build && mkdir -p build && cd build \
1212

1313
FROM debian:stable-slim
1414

15-
COPY --chmod=755 scripts/run.sh /usr/sbin/run
15+
RUN apt-get update && apt-get install -y iproute2 libsasl2-2
16+
RUN rm -rf /var/lib/apt/lists/*
1617

1718
ARG VERSION=0
1819

20+
COPY --chmod=755 --from=build /ws/scripts/run.sh /usr/sbin/run
21+
COPY --chmod=755 --from=build /ws/scripts/install.sh /usr/sbin/install
1922
COPY --chmod=755 --from=build /usr/bin/collectord /usr/bin/
2023
COPY --from=build /usr/etc/bgpdata/collectord.conf /usr/etc/bgpdata/collectord.conf
2124

2225
# Install
23-
RUN scripts/install.sh
26+
RUN /usr/sbin/install
2427

2528
VOLUME ["/config"]
2629

scripts/run.sh

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#!/bin/bash
2-
# All-in-One run script
3-
#
4-
# Copyright (c) 2021 Cisco Systems, Inc. and Tim Evens. All rights reserved.
5-
#
6-
# Author: Tim Evens <tim@openbmp.org>
7-
#
2+
# Copyright (c) 2021 Cisco Systems, Inc. and Tim Evens.
3+
# All rights reserved.
4+
85
ADMIN_ID=${ADMIN_ID:="collector"}
96

107
DOCKER_HOST_IP=$(ip route | grep default | head -1 | awk '{ print $3}')
@@ -24,13 +21,6 @@ else
2421
fi
2522
fi
2623

27-
28-
if [[ -f /config/collectord ]]; then
29-
source /config/collectord
30-
else
31-
source /etc/default/collectord
32-
fi
33-
3424
#
3525
# System info
3626
#
@@ -52,13 +42,9 @@ fi
5242

5343

5444
# Update collectord config file
55-
COLLECTOR_CFG_FILE=/usr/etc/openbmp/collectord.conf
56-
sed -r -i "s/admin_id:.*/admin_id: ${ADMIN_ID}/" /usr/etc/openbmp/collectord.conf
57-
sed -r -i "s/localhost:9092/${KAFKA_FQDN}/" /usr/etc/openbmp/collectord.conf
58-
59-
if [[ -f /config/collectord.conf ]]; then
60-
COLLECTOR_CFG_FILE=/config/collectord.conf
61-
fi
45+
COLLECTOR_CFG_FILE=/usr/etc/bgpdata/collectord.conf
46+
sed -r -i "s/admin_id:.*/admin_id: ${ADMIN_ID}/" /usr/etc/bgpdata/collectord.conf
47+
sed -r -i "s/localhost:9092/${KAFKA_FQDN}/" /usr/etc/bgpdata/collectord.conf
6248

6349
# Startup delay to allow for Kafka to start if not already running
6450
echo "Waiting 30 seconds to allow for Kafka and other containers to startup."

0 commit comments

Comments
 (0)