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

Feature : provide a Docker image #7

Open
DanielCastronovo opened this issue Dec 13, 2023 · 4 comments
Open

Feature : provide a Docker image #7

DanielCastronovo opened this issue Dec 13, 2023 · 4 comments

Comments

@DanielCastronovo
Copy link

Hello, could you please provide a Docker image ?

@jmathew
Copy link

jmathew commented Dec 27, 2023

This is how I use this in the dockerfile.

# Build k6 with this extension.
FROM grafana/xk6:latest as buildk6
WORKDIR /app
RUN xk6 build --with github.com/LeonAdato/xk6-output-statsd

# Use custom k6 instead of packaged k6. You probably don't need to use the k6 image as the base, 
# likely any old distro will do, but I am lazy so I didnt bother to change it.
FROM grafana/k6:latest
WORKDIR /app
COPY --from=buildk6 /app/k6 .

# You'd want to copy in 'test.js' from where ever usually something like this. In my case I build my 
# tests from TS so it's actually copied from another docker build stage. I've omitted that from here 
# because it's not relevant.
# COPY ["tests.js", "./"]

ENTRYPOINT ["./k6", "run", "-o","output-statsd", "tests.js"] 

@Georift
Copy link

Georift commented May 6, 2024

I threw together this container for my own usages. Might be useful for you: https://github.com/Georift/k6-statsd

@LeonAdato
Copy link
Owner

Sorry for taking so long to get back to this, but the repo currently contains the a docker-compose.yml that will run graphite composer From within your cloned repo, you can just run docker compose up and then view it at http://localhost:80/.

Or am I misunderstanding what you want?

@Georift
Copy link

Georift commented Jun 3, 2024

@LeonAdato at least for my use-case a published container image makes it easier to deploy a k6 task to a cluster.

At the moment k6 already ships a prebuilt container but if you want to also emit StatsD metrics you're now on your own and need to hand roll the build and manage publishing of artifacts.

I'd be happy to submit a PR with my linked container image if it's something you'd be receptive to. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants