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

Put a Readme in the docker directory #50

Closed
schochastics opened this issue Feb 14, 2023 · 3 comments
Closed

Put a Readme in the docker directory #50

schochastics opened this issue Feb 14, 2023 · 3 comments
Assignees

Comments

@schochastics
Copy link
Member

Would it make sense to put a readme into the output directory which explains how to run the dockerfile on different OS?
I could imagine that being helpful for non-docker users

@chainsawriot
Copy link
Collaborator

A good idea. Could you implement this?

@schochastics schochastics self-assigned this Feb 14, 2023
@schochastics
Copy link
Member Author

Here is a first draft. Suggestions?

This README offers some guidance on how to work with the included docker container 
which was created with the R package rang on `Sys.Date()`

# Installing docker

The installation depends on the OS you are running
Follow the steps outlined in the official docs: https://docs.docker.com/engine/install/
For Windows, you can also check out https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment


# Run the docker container
Open a command prompt window (In Windows this could be the built-in command prompt, PowerShell, or Windows Terminal)
navigate to output_dir in the command prompt: `cd output_dir`

Note that all docker commands below might need sudo rights on Linux distros
If you want to run docker without sudo, follow the steps outlined here: https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user

## image=="r-ver"
docker build -t rang .
docker run --rm --name "rangtest" -ti rang

You can change the --name paramater to something more suitable for your container
An R command prompt should open. To confirm that you have succesfully gone back in time, 
use the `sessionInfo()` command 

## image == "rstudio"
docker build -t rang .
docker run -p 8787:8787 -e PASSWORD=abc123 --rm --name "rangtest" -ti rang

You can change the --name paramater to something more suitable for your container
when the building is finished, open a browser and go to localhost:8787
The default username is rstudio, password as specified above (in this case abc123).
To confirm that you have succesfully gone back in time, 
use the `sessionInfo()` command  

## Need more information about docker?

- Consult the docker documentation: https://docs.docker.com/get-started/
- Consult this docker tutorial: https://docker-curriculum.com/ 
- Using Windows? Checkout Microsofts documentation: https://learn.microsoft.com/en-us/virtualization/windowscontainers/

## Issues?

If you are unable to run this docker container please file an issue at https://github.com/chainsawriot/rang/issues
containing the following information:

- The `resolve()` command you executed in R
- The `dockerize()` command you executed in R 
- The error message shown in your command prompt

@chainsawriot
Copy link
Collaborator

@schochastics LGTM

chainsawriot added a commit that referenced this issue Feb 15, 2023
adding readme to the output folder (#50)
chainsawriot added a commit that referenced this issue Feb 15, 2023
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

2 participants