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

Fixed docker command in get started doc #1838

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

atilbian
Copy link
Contributor

@atilbian atilbian commented Jan 10, 2025

What?

It fixes the docker command listed in the Get started documentation following #1536

Checklist

  • I have used a meaningful title for the PR.
  • I have described the changes I've made in the "What?" section above.
  • I have performed a self-review of my changes.
  • I have run the npm start command locally and verified that the changes look good.
  • I have made my changes in the docs/sources/k6/next folder of the documentation.
  • I have reflected my changes in the docs/sources/k6/v{most_recent_release} folder of the documentation.
  • I have reflected my changes in the relevant folders of the two previous k6 versions of the documentation (if still applicable to previous versions).

Related PR(s)/Issue(s)

@atilbian atilbian requested review from heitortsergent and a team as code owners January 10, 2025 10:16
@atilbian atilbian requested review from oleiade and codebien and removed request for a team January 10, 2025 10:16
Copy link
Collaborator

@heitortsergent heitortsergent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atilbian thanks for opening the PR! It looks good to me, I'll wait for one of the other reviews to take a look as well before merging this. 🙇

@heitortsergent heitortsergent self-assigned this Jan 10, 2025
@@ -33,7 +33,7 @@ To run a simple local script:
```

```docker
$ docker run --rm -i -v $PWD:/app -w /app grafana/k6 new
$ docker run --rm -i --user $UID -v $PWD:/app -w /app grafana/k6 new
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ docker run --rm -i --user $UID -v $PWD:/app -w /app grafana/k6 new
$ docker run --rm -i --user $UID -v $PWD:/app -w /app grafana/k6 new

This is bash dependent, should we use instead $(id -u)? @oleiade Does it work for you on fish?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. In fish I have to quote "$ENV_VARIABLE", but --user "$UID" does work. Let's not bother too much about fish because it has its set of differences with standard shells like $(id -u) would be (id -u) anyway.

I do think switching to $(id -u) to be a good idea nonetheless anyway 👍🏻 (fish users will know what to do about it 🙇🏻

@codebien
Copy link
Contributor

codebien commented Jan 13, 2025

Hey @atilbian,
as for the discussion before I would go with the following command:

$ docker run --rm -u $(id -u) -v $PWD:/app -w /app grafana/k6 new

it includes the following improvements:

  • It removes the -i flag that isn't relevant for this command
  • It uses the $(id -u) as we discussed in the dedicated discussion
  • It uses the compact version of the --user flag

@CLAassistant
Copy link

CLAassistant commented Jan 14, 2025

CLA assistant check
All committers have signed the CLA.

@atilbian atilbian requested a review from codebien January 14, 2025 08:22
@codebien
Copy link
Contributor

@atilbian thanks for your contribution 🙇

@heitortsergent heitortsergent merged commit 4a1ce30 into grafana:main Jan 14, 2025
3 of 4 checks passed
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

Successfully merging this pull request may close these issues.

Document usage of k6 new command when used in the context of Docker
5 participants