-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Make it possible to override the volume mounts and shell for the dev container #1511
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
Conversation
82f41a5 to
869088e
Compare
Codecov Report
@@ Coverage Diff @@
## master #1511 +/- ##
=======================================
Coverage 55.32% 55.32%
=======================================
Files 283 283
Lines 19330 19330
=======================================
Hits 10694 10694
Misses 7939 7939
Partials 697 697 |
869088e to
53b9f4b
Compare
6de0220 to
ebf42f7
Compare
|
Small review please? :) |
…container Through the `DOCKER_CLI_MOUNTS` and `DOCKER_CLI_SHELL` env variables. Also allows setting the dev container name through the `DOCKER_CLI_CONTAINER_NAME` env var. The motivation for allowing overriding the volume mounts is the same as for moby/moby#37845, namely that I/O perf on native mounted disks on non-Linux (notably Mac OS) is just terrible, thus making it a real pain to develop: one has to choose between re-building the image after every single change (eg to run a test) or just work directly inside the same container (eg with vim, but even then one would have to re-configure their dev container every time it gets destroyed - containers, after all, are not supposed to be long-lived). Allowing to override DOCKER_CLI_MOUNTS makes it easy for everyone to decide what their volume/syncing strategy is; for example one can choose to use [docker-sync](https://github.com/EugenMayer/docker-sync). As for the shell, it's nice to be able to use bash instead of the more bare-bones `ash` if preferred. Finally, being able to name the container can come in handy for easier scripting on the host. This patch won't change anything for anyone who doesn't set these env variables in their environment. Signed-off-by: Jean Rouge <rougej+github@gmail.com>
e75d976 to
b039db9
Compare
silvin-lubecki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, if it helps developing on the docker/cli repo 👍
|
SGTM as well! |
|
Thanks @andrewhsu and @silvin-lubecki for the review :) What's the process to get it merged at this point? |
cpuguy83
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks! |
- What I did
This patch provides some way for non-Linux devs to work on this repo without
suffering too much from the notorious terrible I/O perf of mounted volumes (eg
on OS X).
- How I did it
We now allow to override the volume mounts and shell for the dev container
through the
DOCKER_CLI_MOUNTSandDOCKER_CLI_SHELLenv variables.We also allow setting the dev container name through the
DOCKER_CLI_CONTAINER_NAMEenv var.The motivation for allowing overriding the volume mounts is the same as for
moby/moby#37845, namely that I/O perf on native mounted
disks on non-Linux (notably Mac OS) is just terrible, thus making it a real
pain to develop: one has to choose between re-building the image after every
single change (eg to run a test) or just work directly inside the same
container (eg with vim, but even then one would have to re-configure their dev
container every time it gets destroyed - containers, after all, are not
supposed to be long-lived).
Allowing to override DOCKER_CLI_MOUNTS makes it easy for everyone
to decide what their volume/syncing strategy is; for example
one can choose to use docker-sync.
As for the shell, it's nice to be able to use bash instead of the more
bare-bones
ashif preferred.Finally, being able to name the container can come in handy for easier
scripting on the host.
This patch won't change anything for anyone who doesn't set these env variables
in their environment.
- How to verify it
The output of:
should be unchanged compared to what it was before this patch; but:
should replace the
-vflag from the command above with just-v test:/test, and finally:should be devoid of any
-vflags (besides the socket one).All the make targets should be unchanged when not setting any of the
new env vars.
- A picture of a cute animal (not mandatory but encouraged)