Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📌 Pin xk6 and plugins #1124

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading