Skip to content
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

provision a docker container #194

Closed
thpham opened this issue May 23, 2014 · 5 comments
Closed

provision a docker container #194

thpham opened this issue May 23, 2014 · 5 comments
Assignees

Comments

@thpham
Copy link

thpham commented May 23, 2014

I’m trying to use kitchen-docker with chef_solo to provision mysql::server cookbook inside a docker container (host: centos6 with devicemapper backend storage and docker container is ubuntu14.04). but during the cook I got a “ERROR 2002 (HY000): Can't connect to local MySQL” during the execute[install-grants].

here is the output : https://gist.github.com/thpham/aa37d305c1341099e51c

Thanks

@alambike
Copy link

alambike commented Jun 5, 2014

I have the same issue trying to install mysql-server in ubuntu12.04 docker container. Upstart isn't available so mysql service refuse to start.
Something like this will be perfect but it seems isn't available yet.
Meanwhile I was trying to monkey patch a Chef::Provider::Service to use supervisor/runit to start mysql in container, using #197 PR. I don't know if there is a better solution.

@thpham
Copy link
Author

thpham commented Jun 5, 2014

@alambike Thanks for the links! a friend did a fork of the mysql cookbook http://bit.ly/1l8vb7u to allow the provisioning with chef-solo and we use supervisor to start mysql.

@joshuacox
Copy link

I can at least confirm that this is indeed still an issue, I've tried both the 5.5.4 from this repo here (opscode-cookbooks/mysql) and the one mentioned by @thpham https://github.com/haad/mysql/ and I still get the same error:

[2014-10-21T20:15:49+00:00] ERROR: Running exception handlers
[2014-10-21T20:15:49+00:00] ERROR: Exception handlers complete
[2014-10-21T20:15:49+00:00] FATAL: Stacktrace dumped to /var/chef/chef-stacktrace.out
[2014-10-21T20:15:49+00:00] ERROR: mysql_service[default] (mysql::server line 20) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[install-grants] (/var/chef/cookbooks/mysql/libraries/provider_mysql_service_ubuntu.rb line 82) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/mysql -u root -proot < /etc/mysql_grants.sql ----
STDOUT: 
STDERR: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
---- End output of /usr/bin/mysql -u root -proot < /etc/mysql_grants.sql ----
Ran /usr/bin/mysql -u root -proot < /etc/mysql_grants.sql returned 1
[2014-10-21T20:15:49+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
2014/10/21 15:15:49 The command [/bin/sh -c chef-solo -c /var/chef/solo.rb -j /var/chef/solo.json] returned a non-zero code: 1

anyone out there successfully using docker, chef-solo, and mysql?

@someara someara self-assigned this Dec 10, 2014
@someara
Copy link
Contributor

someara commented Dec 15, 2014

Hi there. The MySQL 6.0.0 release has separated the :create and :start actions. You should now be able to use a mysql_service resource in a recipe with the :create action, and it will not attempt to start the service with any init system, allowing you to start it externally from your Dockerfile.

@someara someara closed this as completed Dec 15, 2014
@lock
Copy link

lock bot commented Jul 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants