Closed wch closed 10 years ago
Hi Winston In order:
-i -t
and making the command /bin/bash
Hi Winston,
Thanks for the feedback / use cases, very helpful.
nsenter
is entirely the way to go here. I put this in my .bashrc
:
function dock { sudo nsenter -m -u -n -i -p -t `docker inspect --format {{.State.Pid}} "$1"` /bin/bash; }
And then I can just use dock rstudio
to enter the container (as root), provided I launched it with the flag --name=rstudio
.
Thanks for the tip about using nsenter
. Now if only nsenter
were simpler to install on host machines...
For installation order, it's not just build time -- it's more about the time that it takes for users to download an updated image. For example, if you first install RStudio and then texlive in an image, then update RStudio and rebuild the image, users will have to download gigabytes more data than if you had installed texlive and then RStudio.
I imagine that doing things this way would result in even more Dockerfiles though. Pretty soon you'll need a Makefile to build all the Dockerfiles. :)
@wch thanks for clarifying, that's a good point. We don't really optimize not changing layers within an image, e.g. we've opted to run apt-get upgrade
at the top of each container. Like you say, that can get complicated quickly. Definitely worth thinking about.
Re. installing nsenter
-- why not just run it as a docker container?
docker run -v /usr/local/bin:/target jpetazzo/nsenter
@cboettig I did actually install nsenter
with that method. It's just that it has to download tons of stuff (the image size is 353 MB) just to compile a ~1MB binary. When you're spinning up VM hosts, it would be nice to make that more efficient.
But if you want a more lightweight r-devel .... then nothing beats building it locally. Just sayin' ...
I'm told that you can get the latest RStudio version by looking at this URL: https://s3.amazonaws.com/rstudio-server/current.ver
And with that info, you can get the URL for latest RStudio build.
Very nice as I just mentioned to Carl over in another thread -- thanks for that!
Regarding point one, have a look at this auto-build.
I'll run it manually for a few days, and may then crontab it.
Excellent!
The 'trick' attempted to shrink he nighly r-devel build worked -- eddelbuettel/drd now comes in at under 800mb which is not too shabby.
Nice! What was the trick?
Single RUN command so that the files "disappear" before the AUFS layer is created. Because once layered, space can currently not be reclaimed. More discussion in this thread I started on docker-user.
@wch Seems like Docker has granted your wish for a better alternative to nsenter
: http://blog.docker.com/2014/10/docker-1-3-signed-images-process-injection-security-options-mac-shared-directories/
With Docker 1.3 you can now just run docker exec -it <container> bash
to enter the container.
Glad you guys are working on this! Sorry to file this as a single issue, but I figured it would be less annoying than filing them as separate issues, at least for now.
Here are some things that would be useful -- for my use cases, at least:
nsenter
is the way to go in the future.)