-
Notifications
You must be signed in to change notification settings - Fork 9
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
its_container block os detection #2
Comments
@nanliu sorry for my delayed answer and thank you for all your information. I'm going to try to search for a way to implement it correctly. But, as you have already seen, it is not an easy task. |
@zuazo, thanks for looking into this. I will take another crack at this issue as well. I recently presented a talk for Portland Docker user group regarding how to use dockerspec in a container. This project received lots of positive feedback, and people were really interested in trying it out. I found the source code of the project to be very well documented, but most people attending wasn't aware of Ruby API docs, so maybe worth including a link in the README to: http://www.rubydoc.info/github/zuazo/dockerspec/Dockerspec |
@nanliu thank you, man 🍺 I don't know what to say. I'm glad to know that this little hack can be useful to others 😃 I can add a link to your presentation in the README if you want. As for the documentation, the first badge in the README points to the documentation of the released gem: Your link (http://www.rubydoc.info/github/zuazo/dockerspec/Dockerspec) is for the master branch documentation. But if you think the link to the documentation might be clearer in another way, or should we write it down elsewhere, feel free to send a PR. I will accept it with open arms. Maybe we should link both the released and master documentation at the beginning of the README? FYI: Whatever progress I make on the OS detection subject, I will write it here. |
Hi @nanliu: Sorry for the delay in my answer. Following your comments and recommendations:
Thanks for your help! |
Thanks for fixing this! |
Released in |
So if I attempt to use dockerspec using docker compose with serverspec os detection:
This results in the following error
gems/specinfra-2.64.0/lib/specinfra/helper/os.rb:30:in 'detect_os': Specinfra failed os detection. (NotImplementedError)
. Digging a bit deeper, this is because when specinfra attempts to obtain uname viaSpecinfra.backend.run_command('uname -m')
the docker_compose backend is missing information on which container to execute the command.Looking at the docker_compose backend, the container settings comes from
get_config(:docker_compose_container).to_s
, the only problem is I'm not sure how to restore this context inrspec/resources/its_container.rb
so the Specinfra.backend.run_command method runs successfully. Any hints or suggestions on how to fix this?p.s.
If I set the
:docker_compose_container
,os[:family]
works:but I'm hoping to get it working in the
its_container
block so this works with any container.The text was updated successfully, but these errors were encountered: