grafana / xk6

Build k6 with extensions
Apache License 2.0
215 stars 20 forks source link

Add Dockerfile and publish image to container registries #62

Closed imiric closed 1 year ago

imiric commented 1 year ago

This allows using xk6 via Docker, without having to setup a local Go environment or install xk6.

Unfortunately, file permissions with mounted volumes are still an issue, without a simple, native fix. fixuid seems to be the modern solution to this, and works well from my tests.

The grafana/xk6 image isn't published yet, which will be done after this is merged, and we make a new release. I've tested publishing to GHCR in my fork, which worked fine.

In the meantime, you can build it with e.g. docker build -t test/xk6 ..

Closes #8

imiric commented 1 year ago

It would probably be good to add some CI tests for the image, right?

I can do that later today.

imiric commented 1 year ago

I'm not quite finished with this, as I want to invite people on macOS and Windows using Docker Desktop to try this out, and see if it works for them as well. :crossed_fingers:

And while I tested the Docker release to GHCR in my fork, we also need to push the image to Docker Hub, so I'll need some help from DevOps, or whoever is managing the Grafana org to create the initial package we can push to.

imiric commented 1 year ago

OK, this should be done now. We confirmed the image works on macOS and Windows, and I updated the instructions.

I also added pushing to Docker Hub. grafana/xk6 is now available, but I haven't yet tested pushing to it. I added the secrets to the repo, and mostly copied the commands from the k6 workflow, so it should work once this is merged. :crossed_fingers:

imiric commented 1 year ago

Thanks for the reviews and testing, everyone! :bow:

In the latest force push I just split the Docker steps for GHCR and Docker Hub, as they're in the k6 workflow file, to avoid breaking publishing on one registry if the other is down.

I'll merge this, and make a release soon (after #60), so we can test the full release process. :crossed_fingers: