-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
32 lines (28 loc) · 1.2 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
FROM golang:1.17 as stage
ARG plugins_url="https://github.com/observiq/stanza-plugins/releases/latest/download/stanza-plugins.zip"
# arm cross builds do not have these symlinks in palce
RUN \
ln -s /usr/bin/dpkg-split /usr/sbin/dpkg-split && \
ln -s /usr/bin/dpkg-deb /usr/sbin/dpkg-deb && \
ln -s /bin/tar /usr/sbin/tar && \
ln -s /bin/rm /usr/sbin/rm && \
echo "resolvconf resolvconf/linkify-resolvconf boolean false" | debconf-set-selections
# unzip is required because tar does not work on arm
RUN apt-get update && apt-get install unzip -y
WORKDIR /stanza/artifacts
RUN curl -fL "${plugins_url}" -o stanza-plugins.zip
RUN unzip stanza-plugins.zip
WORKDIR /stanza
COPY . .
RUN make build
RUN mv "artifacts/stanza_$(go env GOOS)_$(go env GOARCH)" artifacts/stanza
FROM gcr.io/observiq-container-images/stanza-base:v1.1.0
RUN mkdir -p /stanza_home
ENV STANZA_HOME=/stanza_home
RUN echo "pipeline:\n" >> /stanza_home/config.yaml
COPY --from=stage /stanza/artifacts/stanza /stanza_home/stanza
COPY --from=stage /stanza/artifacts/plugins /stanza_home/plugins
ENTRYPOINT /stanza_home/stanza \
--config /stanza_home/config.yaml \
--database /stanza_home/stanza.db \
--plugin_dir /stanza_home/plugins