-
Notifications
You must be signed in to change notification settings - Fork 496
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
Add docker-setup hook #585
Conversation
@tsvallender - I'm not sure why the test is failing, at first glance it looks like it should work. If you move the calling the hook into |
fdaa3a3
to
6d932b2
Compare
Thanks for the feedback. I’ve made the changes you suggested and done another manual test. Still getting the same error in the test suite though so any thoughts on that appreciated! I can see the |
6d932b2
to
4ffe216
Compare
Just done a bit more investigation and it seems like in the test environment the hook isn’t running because |
4ffe216
to
e6fac85
Compare
Hm, made a bit more progress. Realised I needed to stub
|
I'm a fan. If this is accepted please make sure to update the documention on hooks accordingly. |
e6fac85
to
c4b7b16
Compare
Just came back to this and managed to get the tests passing 🙌 Hopefully it can progress now—if there’s anything I can do to make that happen let me know. |
This allows the user to make any necessary configuration changes to Docker before setting up any containers, allowing those configuration changes to take effect from the outset.
c4b7b16
to
f69c45b
Compare
This hook has just been merged into Kamal, so adding the documentation. basecamp/kamal#585
The kamal remove command does not remove the network created with this command. Is this the expected behaviour? |
Good question. Debatable, I suppose. I guess adding another hook at the point of removal might be the best way to do this. I can take a look at adding this in soon. |
This allows the user to make any necessary configuration changes to Docker before setting up any containers, allowing those configuration changes to take effect from the outset.
My primary motivation for adding this was wanting all the containers to be on the same Docker network. This change means the
docker-setup
hook script can ensure the network exists before deployment rather than needing to do so manually. This should be more broadly useful for any general Docker configuration that may be necessary by the user, however. The new hook point is necessary so it can be done after we ensure Docker is installed but before deploying any containers.I’ve tested this manually but don’t fully understand the way hooks are being tested so would appreciate some assistance getting the new test to pass.