forked from sathishdsgithub/kubequery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (31 loc) · 1.37 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
# Copyright (c) 2020-present, The kubequery authors
#
# This source code is licensed as defined by the LICENSE file found in the
# root directory of this source tree.
#
# SPDX-License-Identifier: (Apache-2.0 OR GPL-2.0-only)
FROM ubuntu:20.04 AS builder
ARG BASEQUERY_VERSION=5.0.2
ADD https://uptycs-basequery.s3.amazonaws.com/${BASEQUERY_VERSION}/basequery_${BASEQUERY_VERSION}-1.linux_amd64.deb /tmp/basequery.deb
RUN dpkg -i /tmp/basequery.deb
# =====
FROM uptycs/busybox:v1.33.0
ARG BASEQUERY_VERSION
ARG KUBEQUERY_VERSION
LABEL \
name="kubequery" \
description="kubequery powered by Osquery" \
version="${KUBEQUERY_VERSION}" \
url="https://github.com/Uptycs/kubequery"
# uptycs/busybox comes with this user predefined. We need a non-root user
USER uptycs
WORKDIR /opt/uptycs
RUN set -ex; \
mkdir /opt/uptycs/bin /opt/uptycs/etc /opt/uptycs/logs /opt/uptycs/var && \
echo "/opt/uptycs/bin/kubequery.ext" > /opt/uptycs/etc/autoload.exts
COPY --from=0 --chown=uptycs:uptycs /opt/osquery/bin/osqueryd /opt/uptycs/bin/basequery
COPY --from=0 --chown=uptycs:uptycs /opt/osquery/share/osquery/certs/certs.pem /opt/uptycs/etc/
COPY --chown=uptycs:uptycs bin/entrypoint.sh bin/kubequeryi bin/uuidgen /opt/uptycs/bin/
COPY --chown=uptycs:uptycs bin/kubequery /opt/uptycs/bin/kubequery.ext
ENV KUBEQUERY_VERSION=${KUBEQUERY_VERSION}
ENTRYPOINT ["/opt/uptycs/bin/entrypoint.sh"]