Fun with Docker and Drupal on CentOS | RHEL

So if you have been following my other posts, you should have your own VM with Docker installed on it.  Well, I wanted to actually do something with Docker and test some of it’s capabilities.  I have created a GitHub repo with a Dockerfile and some scripts to get Drupal up and running on CentOS.  This is valuable for people learning Drupal as the container is transient.  If you mess something up, just restart the container.  You will need to go back through the setup screens, but you are at a clean state.  If you want to check mark your work, you could commit the container at specific intervals.  This is really great if you are a drupal developer.  If you have your repository, you could work on different client’s drupal setups over different timelines by just instantiating the correct commit.

Here are the directions for setting things up:

Docker Drupal 101

Here is what you should have after following the directions.

Configure_site___Drupal-4

I’ll follow up later with some potential workflows!

Tagged ,

3 thoughts on “Fun with Docker and Drupal on CentOS | RHEL

  1. ScottK says:

    Very much appreciating your posts – very helpful! Thanks.

  2. ScottK says:

    Hmm – Followed your instuctions on github, and get these errors:

    $ docker run -p 80:80 -t -i snk/drupal-mysql supervisord

    /usr/lib/python2.6/site-packages/supervisor-3.0-py2.6.egg/supervisor/options.py:295: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a “-c” argument specifying an absolute path to a configuration file for improved security.
    ‘Supervisord is running as root and it is searching ‘
    2014-01-15 09:41:19,572 CRIT Supervisor running as root (no user in config file)
    2014-01-15 09:41:19,620 CRIT Server ‘inet_http_server’ running without any HTTP authentication checking
    2014-01-15 09:41:19,621 INFO supervisord started with pid 1
    2014-01-15 09:41:20,624 INFO spawned: ‘httpd’ with pid 11
    2014-01-15 09:41:20,628 INFO spawned: ‘mysqld’ with pid 12
    2014-01-15 09:41:21,111 INFO exited: mysqld (exit status 0; not expected)
    2014-01-15 09:41:22,112 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
    2014-01-15 09:41:22,115 INFO spawned: ‘mysqld’ with pid 117
    2014-01-15 09:41:22,851 INFO exited: mysqld (exit status 0; not expected)
    2014-01-15 09:41:24,855 INFO spawned: ‘mysqld’ with pid 215
    2014-01-15 09:41:25,608 INFO exited: mysqld (exit status 0; not expected)
    2014-01-15 09:41:28,615 INFO spawned: ‘mysqld’ with pid 313
    2014-01-15 09:41:29,353 INFO exited: mysqld (exit status 0; not expected)
    2014-01-15 09:41:30,355 INFO gave up: mysqld entered FATAL state, too many start retries too quickly

    any hints what I’ve done wrong?

    • I ran into the same issue. I ended up running mysql the init script and then committing the image. then is was able to run the supervisor script. you can also try to startup the image using /bin/bash instead of supervisorsd and then run supervisor from the container and see what errors you get int he /var/log/mysqld/mysql.log

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: