Skip to content

Commit

Permalink
📌 Pin xk6 and plugin versions
Browse files Browse the repository at this point in the history
* `xk6-see` isn't compatible with k6>=0.53
* Pin `xk6` and all plugins to the latest compatible versions
* Also bump Golang to `1.23`
  • Loading branch information
rblaine95 committed Oct 17, 2024
1 parent a8e088a commit 10ae3ae
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions scripts/k6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
# Use the official Go image as the base image
FROM golang:1.22 AS builder
FROM docker.io/golang:1.23 AS builder

# Set the working directory inside the container
WORKDIR /app

# Install xk6 and build with specified extensions in a single step to reduce layers
RUN go install go.k6.io/xk6/cmd/xk6@latest && \
xk6 build --output /usr/local/bin/xk6 \
--with github.com/avitalique/xk6-file@latest \
--with github.com/phymbert/xk6-sse
# xk6-sse doesn't support k6>=0.53
# https://github.com/phymbert/xk6-sse/issues/19
RUN go install go.k6.io/xk6/cmd/[email protected]
RUN xk6 build --output /app/xk6 \
--with github.com/avitalique/[email protected] \
--with github.com/phymbert/[email protected]

# Use a minimal base image for the final stage
FROM alpine:3.20
FROM docker.io/alpine:3

# Copy the built xk6 binary from the builder stage
COPY --from=builder /usr/local/bin/xk6 /usr/local/bin/xk6
COPY --from=builder /app/xk6 /usr/local/bin/xk6

# # Set the entrypoint to xk6
ENTRYPOINT ["/usr/local/bin/xk6"]

0 comments on commit 10ae3ae

Please sign in to comment.