harbor
harbor copied to clipboard
Add environmental variables
First of all, thank you for your work on this package!
I am trying to run docker containers that require environmental variables. In bash, the command would be something like docker run --env SOME_VARIABLE_1=some_value_1 --env SOME_VARIABLE_2=some_value_2 my_docker_image
. However, I am strugling to make this work in harbor
. I've tried the versions below to no avail. Is this supported? Where am I going wrong?
harbor::docker_run(
image = 'my_docker_image',
docker_opts = c(
'SOME_VARIABLE_1' = 'some_value_1',
'SOME_VARIABLE_2' = 'some_value_2')
capture_text = TRUE)
harbor::docker_run(
image = 'my_docker_image',
docker_opts = '--env SOME_VARIABLE_1=some_value_1 --env SOME_VARIABLE_2=some_value_2)
capture_text = TRUE)
Thanks a lot in advance for your help
Hi @JanLauGe (I hope @wch won't mind me pointing to another package, AFAIK harbor
is not under active development anymore.),
have you taken a look at stevedore
? https://cran.r-project.org/package=stevedore
There is an env
argument in docker$container$create(..)
.
Cool, thanks for pointing this out!
My workaround in the meantime was to use the python module docker
and the reticulate
packagewhich did the trick as well. I'll definitively check out
stevedore` as well, thank you!