2018-07-22 04:04:50 +02:00
|
|
|
FROM golang:alpine AS builder
|
2018-07-22 02:02:26 +02:00
|
|
|
MAINTAINER Jessica Frazelle <jess@linux.com>
|
|
|
|
|
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
|
|
|
ENV GOPATH /go
|
|
|
|
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
ca-certificates \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
make \
|
|
|
|
npm \
|
|
|
|
yarn
|
|
|
|
|
2020-05-15 08:13:42 +02:00
|
|
|
ENV FLEET_VERSION 2.6.0
|
2018-07-22 02:02:26 +02:00
|
|
|
|
|
|
|
RUN git clone --depth 1 --branch "${FLEET_VERSION}" https://github.com/kolide/fleet.git /go/src/github.com/kolide/fleet
|
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/kolide/fleet
|
|
|
|
|
2019-08-31 02:52:57 +02:00
|
|
|
ENV GO111MODULE on
|
|
|
|
|
2018-07-22 02:02:26 +02:00
|
|
|
RUN make deps generate
|
|
|
|
|
|
|
|
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /usr/bin/fleet ./cmd/fleet
|
|
|
|
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /usr/bin/fleetctl ./cmd/fleetctl
|
|
|
|
|
2018-07-22 04:04:50 +02:00
|
|
|
FROM r.j3ss.co/osquery AS osquery
|
|
|
|
|
2018-07-22 02:02:26 +02:00
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
COPY --from=builder /usr/bin/fleet /usr/bin/fleet
|
|
|
|
COPY --from=builder /usr/bin/fleetctl /usr/bin/fleetctl
|
|
|
|
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
|
2018-07-22 04:04:50 +02:00
|
|
|
COPY --from=osquery /usr/share/osquery/packs /packs
|
2018-07-22 02:02:26 +02:00
|
|
|
|
|
|
|
ENTRYPOINT [ "fleet" ]
|
|
|
|
CMD [ "--help" ]
|