-
Notifications
You must be signed in to change notification settings - Fork 20
/
Dockerfile
49 lines (41 loc) · 1.49 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
FROM ubuntu:focal
LABEL authors='SolarWinds AppOptics team <technicalsupport@solarwinds.com>'
USER root
ARG DEBIAN_FRONTEND=noninteractive
ARG swisnap_repo=swisnap
ENV SNAP_URL=http://127.0.0.1:21413
RUN apt-get update && \
apt-get upgrade -y && \
apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
docker.io \
gnupg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN arch="$(uname -m)" && if [ "${arch}" = "aarch64" ]; then \
yq_arch=arm64; \
elif [ "${arch}" = "x86_64" ]; then \
yq_arch=amd64; \
fi && \
curl -L "https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_${yq_arch}" -o yq && \
mv yq /usr/bin/yq && \
chmod +x /usr/bin/yq
ARG swisnap_version
RUN echo "deb https://packagecloud.io/solarwinds/${swisnap_repo}/ubuntu/ focal main" > /etc/apt/sources.list.d/swisnap.list && \
curl -L https://packagecloud.io/solarwinds/${swisnap_repo}/gpgkey | apt-key add - && \
apt-get update && \
apt-get -y install solarwinds-snap-agent=${swisnap_version} && \
usermod -aG root solarwinds && \
apt-get -y purge curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
mkdir -p /tmp/SolarWinds/Snap \
/var/log/SolarWinds/Snap \
/var/run/SolarWinds/Snap
COPY ./conf/swisnap-init.sh /opt/SolarWinds/Snap/etc/init.sh
WORKDIR /opt/SolarWinds/Snap
EXPOSE 21413
# Run SolarWinds Snap Agent
CMD ["/opt/SolarWinds/Snap/etc/init.sh"]