fleet/infrastructure/loadtesting/terraform/docker/loadtest.Dockerfile
Lucas Manuel Rodriguez 682202444c
Update go to 1.26.2 and update tooling to update it (#43771)
Golang 1.26.2 has been released. It fixes some CVEs:
https://github.com/golang/go/issues?q=milestone%3AGo1.26.2+label%3ACherryPickApproved

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated Go toolchain to 1.26.2 across the repository and build
configs.
  * Updated Docker build images to use Go 1.26.2.
* Expanded the set of tracked modules for the Go version update so
additional module files are included in automated updates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-20 13:40:57 -03:00

36 lines
1.6 KiB
Docker

FROM golang:1.26.2-alpine3.23@sha256:80fbb8f9b2fa541a7d34378f1ad10f4f1c433817c4ed39ddb3e2f3ec3e961271
ARG TAG
RUN apk add git sqlite gcc musl-dev sqlite-dev
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 .
# Generate software database from SQL file
RUN cd /go/fleet/cmd/osquery-perf/software-library && \
ls -lh && \
if [ ! -f software.sql ]; then \
echo "ERROR: software.sql not found in software-library directory"; \
exit 1; \
fi && \
echo "Generating software.db from software.sql..." && \
rm -f software.db && \
sqlite3 software.db < software.sql && \
if [ ! -f software.db ]; then \
echo "ERROR: Failed to generate software.db"; \
exit 1; \
fi && \
echo "Validating database..." && \
sqlite3 software.db "SELECT COUNT(*) FROM software;" && \
echo "Successfully generated software.db ($(du -h software.db | cut -f1))"
FROM alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659
LABEL maintainer="Fleet Developers"
# Create FleetDM group and user
RUN addgroup -S osquery-perf && adduser -S osquery-perf -G osquery-perf
COPY --from=0 /go/fleet/cmd/osquery-perf/osquery-perf /go/osquery-perf
COPY --from=0 /go/fleet/server/vulnerabilities/testdata/ /go/fleet/server/vulnerabilities/testdata/
# Copy software database (generated in builder stage)
COPY --from=0 /go/fleet/cmd/osquery-perf/software-library/ /go/software-library/
RUN apk update && apk upgrade && apk add --no-cache sqlite-libs
WORKDIR /go
USER osquery-perf