Comments (6)
First of all, I should add runit support for you so you don't have to manually do this. Should be fairly doable with how I have things setup correctly and can support both the docker daemon and docker_container
resources.
I'd highly recommend using the Chef community runit cookbook: https://github.com/hw-cookbooks/runit, which is what I'd base any implementation of mine on (using the runit_service
resource). The Heavy Water folks and contributors have already done most, if not all, of the heavy lifting for runit!
Hope this helps. Will keep open until runit support is added.
from docker.
Thanks for the help and willingness to extend the existing functionality. I have the runit cookbook being used as a dependency for my web server (Nginx), so I guess I have looked into it somewhat, but was stumbling to try to figure out how to get it to work with the chef-docker cookbook. I definitely am looking forward to this new functionality!
from docker.
Released initial support for runit in 0.31.0 of the cookbook. Set your init_type or container_init_type attributes to runit and hopefully this will get you started.
from docker.
I just started testing Runit again. I set the "container_init_type": "runit". When I run my recipe a second time and when it hits the section for stopping a container it errors out.
I have the following to stop a potential running container:
docker_container "#{app.name}" do
action :stop
end
Error I get:
Recipe: deployment::none
* service[webapp] action stop
* /etc/init.d/webapp does not exist!
================================================================================
Error executing action `stop` on resource 'service[webapp]'
================================================================================
Chef::Exceptions::Service
-------------------------
/etc/init.d/webapp does not exist!
Resource Declaration:
---------------------
# In /home/deployer/chef-solo/cookbooks-2/docker/providers/container.rb
238: service service_name do
239: case new_resource.init_type
240: when 'systemd'
241: provider Chef::Provider::Service::Systemd
242: when 'upstart'
243: provider Chef::Provider::Service::Upstart
244: end
245: supports :status => true, :restart => true, :reload => true
Compiled Resource:
------------------
# Declared in /home/deployer/chef-solo/cookbooks-2/docker/providers/container.rb:238:in `service_action'
service("webapp") do
action [:stop]
supports {:status=>true, :restart=>true, :reload=>true}
retries 0
retry_delay 2
service_name "webapp"
pattern "webapp"
cookbook_name :"deployment"
recipe_name "none"
end
Any ideas or things I need to set to get this to work in my Debian 7 environment? Thanks!
from docker.
@mickelsonm are you still having trouble with runit?
from docker.
@bflad : Hey thanks for the follow-up! Unfortunately,I wasn't able to get it to go. I am trying to remember what I tried (month ago...sorry), but I do remember setting "container_init_type": "runit", which partially worked the first time I ran my deployment script, but on the second time it raised the error I mentioned.Not really sure on the how or why without re-testing it.
from docker.
Related Issues (20)
- (debian-9, installation-script-main) is no longer a valid test HOT 1
- Changelog weirdness
- Containers with embedded health checks restart on every Chef run
- Logging drivers are out of sync
- Can't stop updates to /lib/systemd/system/docker.service
- README.md is missing resources / broken links
- Setting a version causes a service restart on every run HOT 4
- docker_installation_tarball group is always reset HOT 1
- Wrong source list generation for Debian 11 HOT 8
- Use docker_image resource with build_if_missing action with buildkit
- Invalid filter 'dangling=[docker_image_prune[cleanup]]'
- docker Chef 18 compatibility HOT 7
- docker-ce package name in ubuntu 22.04 is in a different format that affects module 'docker_installation_package' HOT 1
- Can't start a simple container
- Dependency Dashboard
- docker_volume_prune resource
- Unable to use `package_name`-property of the `docker_service`-resource
- PR #1253 is a breaking change. Break on CentOS 7 (Old kernel without cgroup v2)
- ipv6 forwarding prevents the daemon to run when ipv6 is disabled in kernel
- docker_container network_mode "container:*" leads to redeploy on every chef client run
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker.