-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add Dockerfile and publish image to container registries #62
Conversation
0e5a6f2
to
78b2ab7
Compare
It would probably be good to add some CI tests for the image, right? I can do that later today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I belive the image test in CI step is a requirement for image publishing, so I'm fine to address it in the following PR.
👍
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[1], without a simple, native fix. fixuid[2] seems to be the modern solution to this, and works well from my tests. Part of #8 [1]: moby/moby#7198 [2]: https://github.com/boxboat/fixuid
8a2c599
to
70d993f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏
Let's see now how many people have really hard time getting the mounting of a local direcotry to work 😅
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. 🤞 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. |
The grafana/xk6 image isn't published yet, which I'll do after the Dockerfile is approved. In the meantime, you can build it with e.g.: docker build -t test/xk6 .
8416806
to
81c43f1
Compare
81c43f1
to
3b5fe53
Compare
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. 🤞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Confirmed on Apple silicon.
``` | ||
|
||
For the native Windows binary if you're using cmd.exe: | ||
```batch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```batch | |
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this is Windows Batch file syntax. I wasn't sure if cmd.exe
or batch
would work, but batch
seems to highlight some syntax, so it's good enough. 🤷♂️
3b5fe53
to
875f6e1
Compare
Thanks for the reviews and testing, everyone! 🙇 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. 🤞 |
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