docker / app

Make your Docker Compose applications reusable, and share them on Docker Hub
Apache License 2.0
1.57k stars 177 forks source link

[Feature Request] Support downloading service images with "pull" command #789

Open doanac opened 4 years ago

doanac commented 4 years ago

Description

We've encountered users of our system that like to separate the downloading of an update from the applying of an update. I would like to add an optional flag to the docker app pull command to tell it to also pull down each of the app's service images. I have no strong opinion of what the flag would be, perhaps: docker app pull --include-services?

I don't have a complete implementation, but adding logic to pull down the images is pretty simple: https://github.com/doanac/app/commit/d808721d12d58fba607a54136f0a7611e51fcb67

silvin-lubecki commented 4 years ago

Hello @doanac , thank you for filling this feature request. I'll put here some thoughts about it:

This feature will have sense only if you target a single engine with swarm enabled (which is your case I guess), or which would be the case for a developer running the app on her own host. But regarding a cluster, only one daemon will pull the images, not all the nodes, so this may not be what's expected (as you don't know which node will execute the workload, so all the nodes but the one targeted will pull the images). A workaround would be to run the docker app pull --include-services on all the nodes 🤔. Another "issue" is when you have 2 contexts (using --installer-context flag), one to execute the invocation image and the one where you actually run the app itself. It means that only the context running the invocation image (usually the local host and the current context) would have pull the images, which is pretty useless 😅 .

That being said, this feature looks a lot like docker-compose pull, and as it's an optional flag and not the default behavior, I guess it's OK to assume the user has the responsibility to check which node is actually pulling the images 👍 Maybe could we make it a little more explicit with an output explaining which node/context is actually pulling? @thaJeztah any thoughts?

doanac commented 4 years ago

Good point about multi nodes and contexts. I guess we have a bit of an edge case. I'm happy to put notes on the flag saying its a little weird. And if its really too awkward for your team to carry this change, I think I could find away to keep this patch in our OE recipe for build docker-app. That said- pushing upstream is always more desirable from my end :)

silvin-lubecki commented 4 years ago

@doanac Please open a PR with your code changes 👍 It would be great to add a test somehow, maybe an e2e test? Please reach me if need help for that!

dberardo commented 3 years ago

i dont know if this links to a problem i am having, but basically when i run the application, the stack is created properly, but the service dont fire up because they dont find their respective images.

The solution is to manually pull each single image for the individual services manually, so i am wondering ... is it possible to automate this process like it would happen normally in swarm? i cannot understand why this does not happen already