vignettes/aa-dev-in-docker.Rmd
aa-dev-in-docker.Rmd
You can use {devindocker} for any directory, project or even package. In the end, these are all folders on your computer.
tempdir <- tempdir()
my_project <- normalizePath(file.path(tempdir, "myproject"), mustWork = FALSE)
usethis::create_package(my_project, open = FALSE)
## ✔ Creating '/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpIR0FmH/myproject/'
## ✔ Setting active project to '/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpIR0FmH/myproject'
## ✔ Creating 'R/'
## ✔ Writing 'DESCRIPTION'
## Package: myproject
## Title: What the Package Does (One Line, Title Case)
## Version: 0.0.0.9000
## Authors@R (parsed):
## * First Last <first.last@example.com> [aut, cre] (YOUR-ORCID-ID)
## Description: What the package does (one paragraph).
## License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
## license
## Encoding: UTF-8
## LazyData: true
## Roxygen: list(markdown = TRUE)
## RoxygenNote: 7.0.0
## ✔ Writing 'NAMESPACE'
## ✔ Setting active project to '<no active project>'
# path <- "" # default
path <- my_project
# Which container with RStudio server? ----
container <- "rocker/geospatial:4.0.1"
# Which port ? ----
# _Useful if multiple Rstudio Server to launch
port <- 8788
# Start Docker project
launch_proj_docker(path = path,
container = container,
port = port)
# Stop Docker properly
stop_proj_docker(path = path, sleep = 5)