reduce the build time of loadtest.Dockerfile (#8584)

- yarn is not needed to build osquery-perf
- we can change the clone step to not fetch unnecessary data
This commit is contained in:
Roberto Dip 2022-11-04 13:20:38 -03:00 committed by GitHub
parent ca4d7e23cb
commit f5d3aa233c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,6 @@
FROM golang:1.19.1
ARG TAG
RUN apt update && apt upgrade -y && apt install npm yarnpkg -y && ln -s /usr/bin/yarnpkg /usr/bin/yarn
RUN git clone -b $TAG https://github.com/fleetdm/fleet.git && cd /go/fleet/cmd/osquery-perf/ && go build .
RUN git clone -b $TAG --depth=1 --no-tags --progress --no-recurse-submodules https://github.com/fleetdm/fleet.git && cd /go/fleet/cmd/osquery-perf/ && go build .
FROM golang:1.19.1
COPY --from=0 /go/fleet/cmd/osquery-perf/osquery-perf /go/osquery-perf