Uh oh!
There was an error while loading. Please reload this page.
Add an explicit noop option for minimal containers that do not have echo - #517
Add an explicit noop option for minimal containers that do not have echo#517vizowl wants to merge 1 commit into
Conversation
Signed-off-by: Christopher Knox <chris@dragonfly.co.nz>
kojiromike
commented
Oct 6, 2014
👍 Thanks for tackling this issue! |
dnephin
commented
Oct 6, 2014
It looks like This only changes an intermediate container, which I don't think is ever started, so I'm not sure this is doing what you expect. If you want to have a data volumes container, you can set |
kojiromike
commented
Oct 6, 2014
@dnephin |
dnephin
commented
Oct 6, 2014
I was also not sure why recreate existed. I believe it is so that the new container has the same name, while still supporting What I'm saying is that I believe if your service has an Which I believe is the same as what you're proposing, just without having to make any code changes. Does this not work? I would think that since the intermediate container never runs, it doesn't really matter what's in the entrypoint? Maybe you'd still have to make a smaller code change? (use |
kojiromike
commented
Oct 6, 2014
dnephin
commented
Oct 6, 2014
Ok, right. But you can probably still fix this with the one line change right? (on the intermediate container) entrypoing=self.options.get('entrypoint', ['echo']),That way setting the entrypoint will be preserved from the yaml. |
kojiromike
commented
Oct 6, 2014
@dnephin this is where |
dnephin
commented
Oct 6, 2014
I don't see how that's an assumption. What you're actually doing is setting an |
vizowl
commented
Oct 6, 2014
@dnephin what you are proposing was my initial solution. However I then realised that that would break the recreate behaviour when using volumes-from on a container with a real entry-point - e.g. The standard library postgres image defines an entrypoint which starts postgres which should not be run during the recreate phase when a user just wants access to the volumes. |
dnephin
commented
Oct 6, 2014
I see what I was missing. |
nathanleclaire
commented
Oct 8, 2014
👍 for this. We just gotten bitten by it. |
jpetazzo
commented
Oct 8, 2014
👍 . /cc @tianon |
bfirsh
commented
Oct 9, 2014
I wonder if starting the container is still necessary too. I wonder if we could also use a small image with a known executable in it. /cc @aanand |
dnephin
commented
Oct 9, 2014
I tried the test suite without the start and wait. There was a volume on the recreated container, but it had a different id. I haven't tried a volume with files to see if the files match. I like the idea of a small image with known executable. I was also thinking that if docker supported removing the name from a container you would be able to do this recreate without the need for an intermediate container. |
aanand
commented
Oct 9, 2014
The current behaviour is hacky as hell, and while I appreciate the need for a solution to the no-op problem, I'm nervous about adding one more hack to the tower. Could we dispose with We'd need to decide what to do when users make changes to a service's |
bfirsh
commented
Oct 9, 2014
Looks like volumes_from moved from create to start in 0.10.0: 80991f1 |
bfirsh
commented
Oct 9, 2014
@aanand that sounds like a good idea. |
bfirsh
commented
Oct 9, 2014
@dnephin@jpetazzo@nathanleclaire How major do you think this problem is? How did you get bitten by it? Do you think it's a blocker for 1.0.0? |
dnephin
commented
Oct 9, 2014
I have not had a problem with it. I build data volumes on Seems to me like the workaround is easy enough (use busybox instead of scratch). I believe the busybox image is only 2.4M, which seems like negligible overhead. I would say not a blocker personally (I just thought the issue was interesting!). |
tianon
commented
Oct 9, 2014
This would work for |
tianon
commented
Oct 9, 2014
(and I plan to make more of them in the future, and hopefully help make them easier to create so other people make more of them, too) |
jpetazzo
commented
Oct 9, 2014
I got bitten by it while using sleeping-beauty for an "environment IMHO, we could use busybox (or something like tianon/true) for the On Thu, Oct 9, 2014 at 8:16 AM, Tianon Gravi notifications@github.com
@jpetazzohttps://twitter.com/jpetazzo |
kojiromike
commented
Oct 9, 2014
If the builtin |
dnephin
commented
Oct 9, 2014
That sounds like a good short-term solution to me (change to |
In cases where the service is using a minimal container, /bin/echo can be created but echo cannot. See docker#517 Signed-off-by: Ben Firshman <ben@firshman.co.uk>
In cases where the service is using a minimal container, /bin/echo can be created but echo cannot. See docker#517 Signed-off-by: Ben Firshman <ben@firshman.co.uk>
bfirsh
commented
Oct 10, 2014
+1 #534 |
bfirsh
commented
Oct 10, 2014
The problem with using |
In cases where the service is using a minimal container, /bin/echo can be created but echo cannot. See docker#517 Signed-off-by: Ben Firshman <ben@firshman.co.uk>
jpetazzo
commented
Oct 14, 2014
Out of curiosity: what's wrong with pulling busybox? On Fri, Oct 10, 2014 at 3:13 AM, Ben Firshman notifications@github.com
@jpetazzohttps://twitter.com/jpetazzo |
bfirsh
commented
Oct 14, 2014
@jpetazzo Nothing – it sounds like a good plan. I just wanted to get the simplest possible fix in for 1.0.0, then we can do a proper fix for 1.0.1. It's a little complex because we don't want to pull busybox on every recreate, so there has got to be some intelligence there. Perhaps just trying to create the container, then if busybox doesn't exist, pulling it. Still, much more complex than 4 extra characters. ;) |
tianon
commented
Oct 14, 2014
If you try to run it and it isn't there, won't the Daemon just auto-pull it? |
bfirsh
commented
Oct 14, 2014
@tianon Nope, that's done client-side! |
tianon
commented
Oct 16, 2014
Pretty sure I just threw up in my mouth, but I definitely believe you. |
hugoduncan
commented
Nov 19, 2014
Just hit this issue with an image that doesn't have /bin/echo. Using a known image for the intermediate container sounds like the best solution to me. |
rocketraman
commented
Nov 20, 2014
I just hit this issue as well -- my data container uses |
tpires
commented
Dec 10, 2014
👍 Just got bitten by it. Using |
pwaller
commented
Jan 20, 2015
|
bfirsh
commented
Jan 29, 2015
dnephin
commented
Jan 29, 2015
I agree |
In cases where the service is using a minimal container, /bin/echo can be created but echo cannot. See docker#517 Signed-off-by: Ben Firshman <ben@firshman.co.uk> Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Jake Utley <jutley@hiya.com>
In order to support data only volumes using minimal images #514 I have added an option that allows a no-op command to be explicitly specified - currently it is assumed to be echo which isn't necessarily available on a minimal image.
I have added a test and updated the documentation.
I am concerned that this approach essentially exposes an internal feature ...