Open rrjjvv opened 1 year ago
Do you have any thoughts around the best/preferred solution? There is a subset of solutions that I'd be willing to implement in some free time.
Roughly speaking, most of the "work around docker:dind
" and "work around v2" solutions I'm willing/comfortable implementing. However, the "support v2" solutions would require decisions from you around maintaining/breaking compatibility (so best left to you folks to implement).
(To save you a quick search: docs on compatibility. After migrating our CI infra to v2, we know of at least one other incompatibility not listed in that page, though it's probably not applicable to how Earthly would use it.)
I like the idea of adding a --compose-load
flag which would simply perform the image loads without the up
.
Note that this would not install docker-compose, it would leave it up to the user to provide their own.
TLDR: Compose v2 causes problems.
The title is misleading (I wasn't actually trying/wanting to use
docker:dind
), but it's a true statement, and the root of the actual problem I wanted to solve.The recommended
earthly/dind:alpine
image solves 99% of my problems, but I have one project where it's preferrable to utilize theINSTALL_DIND
UDC on top of an unrelated image. I was getting annoyed with theVERSION
warning, so went to create a PR for it (already tracked in #5). It's a one-line fix, but I still ran the tests, and was surprised to see them fail.The root cause of the test failures is a combination of two things:
docker:dind
image currently bundles a V2 compose (but with adocker-compose
symlink, which satisfies the auto-install check)There are many ways to deal with this; if there was a clear "best" solution I would have submitted a PR. This is far from exhaustive (and some can be combined), but the 'easy' potential solutions:
docker:dind
from the test suite (it's presence implies it's supported)-p
to the compose invocations (which lets the compose file live in the root directory)write_compose_config
and use the resulting config (not to conflate multiple issues, but doing this may address a bug-not-yet-reported, and the fact that it writes to a non-root directory is what solves the immediate problem)The non-easily solutions basically amount to "natively support V2" (which could also pave the way for #6). That's further complicated due to "natively supporting V2" can mean supporting the V2 version (what we're dealing here, since there's a compatibility symlink), or supporting the V2 CLI syntax (i.e.,
docker compose
vs.docker-compose
).Another possibility (but an obviously breaking change) would be to drop support for
--compose
entirely. That sounds crazy... but personally, if there was a--load docker-compose.yml
, I doubt I would ever use--compose
. In other words, the value (for me) is the loading of images, not in saving me from doingup
myself (which is usually a hindrance). I may bring this up as feature request in the main earthly project, but figured I'd throw it out there in case it spurred other thoughts.Again, this issue (as described in the title) does not actually impact me (though it may impact someone else). But it does impact the ability to add changes to this repo due to the failing tests.
Isolating it to the one failing test:
(A
-p foo
, or moving the compose file to/foo/
, would both result in a valid container name offoo-hello-1
.)