Comments (10)
I agree this could be improved. I thought error! Fails with any non-zero exit status. Is this what makes sense in all cases? Should we have retries, etc for exit codes in any places and how would the implementation look? Thanks for the consideration
from docker.
It seems till the next release of docker this won't be much use anyway as there a lot of fixes for things exiting with the wrong exit code mainly, 0 with an error. See a
moby/moby#3767 and moby/moby#3775
from docker.
I agree this could be improved. I thought error! Fails with any non-zero exit status. Is this what makes sense in all cases? Should we have retries, etc for exit codes in any places and how would the implementation look? Thanks for the consideration
It probably makes sense to have both a docker_cmd!
that checks error codes and a docker_cmd
that doesn't. I've started working on a local changeset, and it seems to have already uncovered some issues in the current cookbook. I've been trying to work through some of those before sharing. I'm not sure on the retries -- that is typically used for network commands, so it might make sense for e.g. a docker pull
. Although it seems like that'd be better place in docker itself.
It seems till the next release of docker this won't be much use anyway as there a lot of fixes for things exiting with the wrong exit code mainly, 0 with an error. See a
moby/moby#3767 and moby/moby#3775
AFAICT, the use of return codes has gotten better and better with each release. docker build
used to always return 0, but it doesn't in the latest release. We could look at output of commands that don't return proper codes if it's important before there's a new docker release...
from docker.
@jcrobak Are your changes in a public repo somewhere? I was also thinking about refactoring the docker_cmd work into the helper library.
from docker.
@jhulten I don't have anything up yet, but I'll try to push up what I have after some cleanups.
from docker.
Here's most of what I have so far: https://github.com/jcrobak/chef-docker/tree/return-code-validation
I haven't been able to get the tests to pass on debian 7 (in particular, the test that service('testcontainerd').must_be_running
-- it seems that chef is falling back to ps
to check that the service is running, which obviously won't work. That doesn't seem related to my changes, though...
from docker.
@jcrobak nice work so far. I'd be happy to merge that into next release. With respect to Debian 7 support, I still have it listed as "Debian 7 (experimental)" in the README, so I wouldn't let that stop you for now given your changes would likely not change that behavior.
from docker.
@bflad Sounds good. I was able to verify that my full changeset (there are a couple more commits atop of what's pushed publicly) passes kitchen tests on all platforms other than Debian 7. Would you prefer if I break the branch into a couple PRs or are you ok with a PR with a few semi-related commits?
from docker.
Ah, sorry I didn't respond to this yesterday. If you already have it in one branch, please feel free to submit as one PR, although may need to rebase. I also have some more minor functionality going into the image provider tonight to match (ha!) the functionality #57 just added to the container provider. If I have time I may look into #59 as well, but that shouldn't affect your work.
from docker.
Fixed in 0.30.0 which will be released tonight.
from docker.
Related Issues (20)
- docker Chef 17 compatibility HOT 1
- (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
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.