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

[docs] add working dir to R package docker run examples #4190

Merged
merged 1 commit into from
Apr 18, 2021

Conversation

jameslamb
Copy link
Collaborator

There are a few examples in the R-package documentation which rely on the use of Docker containers. These involve mounting in the current working directory, and then running cd to change directories to that location.

This PR proposes a minor change to remove that manual use of cd, just to make those examples slightly easier to use.

# before: run the container and then cd
docker run \
    -v $(pwd):/opt/LightGBM \
    -it ubuntu:latest \
    cd /opt/LightGBM && do-something

# after: run the container with working directory set to the location LightGBM is mounted in at
docker run \
    -v $(pwd):/opt/LightGBM \
    -w /opt/LightGBM \
    -it ubuntu:latest \
    do-something

@jameslamb jameslamb added the doc label Apr 17, 2021
@jameslamb jameslamb requested a review from StrikerRUS April 17, 2021 04:55
@jameslamb jameslamb requested a review from Laurae2 as a code owner April 17, 2021 04:55
Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

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

Thanks!

-t ubuntu:20.04 \
/bin/bash -c "cd /opt/LightGBM && ./R-package/recreate-configure.sh"
./R-package/recreate-configure.sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it working without /bin/bash?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep! The file is executable and has the shebang #!/bin/bash at the top.

I tested this before pushing the PR, so I'm confident in it.

@jameslamb jameslamb merged commit 7ea2bc4 into microsoft:master Apr 18, 2021
@jameslamb jameslamb deleted the docs/docker-commands branch April 18, 2021 03:45
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants