hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.28k stars 4.44k forks source link

Mariadb Docker container doesn't run from Vagrantfile, does run via vagrant ssh #5075

Closed antgel closed 9 years ago

antgel commented 9 years ago

I'm having a problem getting a mariadb Docker container to run when the VM is provisioned. Here's the relevant part of my Vagrantfile:

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.provision "docker" do |d|
      d.run "mariadb",
          args: "--name mariadb -e MYSQL_ROOT_PASSWORD=mariadb -d mariadb"
  end
end
antony@antony-Lenovo-IdeaPad-Y510P ~/vagrant $ vagrant up
<snip>
antony@antony-Lenovo-IdeaPad-Y510P ~/vagrant $ vagrant ssh
<snip>
vagrant@vagrant-ubuntu-trusty-64:~$ docker logs mariadb
/docker-entrypoint.sh: line 42: exec: mariadb: not found

Yet, it does seem to work if i ssh into the vagrant VM. See below. What's wrong? Can I provide any more useful info to help you debug this?

antony@antony-Lenovo-IdeaPad-Y510P ~/vagrant $ vagrant ssh
vagrant@vagrant-ubuntu-trusty-64:~$ docker run --name mariadb -e MYSQL_ROOT_PASSWORD=mariadb -d mariadb
9684dc6212843d42f1f82b3c65110879c3483cc3a6589165e2e084cd1074782d
vagrant@vagrant-ubuntu-trusty-64:~$ docker logs mariadb
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
141217 13:05:39 [Note] InnoDB: Using mutexes to ref count buffer pool pages
141217 13:05:39 [Note] InnoDB: The InnoDB memory heap is disabled
141217 13:05:39 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
141217 13:05:39 [Note] InnoDB: Memory barrier is not used
141217 13:05:39 [Note] InnoDB: Compressed tables use zlib 1.2.7
141217 13:05:39 [Note] InnoDB: Using Linux native AIO
141217 13:05:39 [Note] InnoDB: Not using CPU crc32 instructions
141217 13:05:39 [Note] InnoDB: Initializing buffer pool, size = 256.0M
141217 13:05:39 [Note] InnoDB: Completed initialization of buffer pool
141217 13:05:39 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
141217 13:05:39 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
141217 13:05:39 [Note] InnoDB: Database physically writes the file full: wait...
141217 13:05:39 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
141217 13:05:39 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
141217 13:05:40 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
141217 13:05:40 [Warning] InnoDB: New log files created, LSN=45781
141217 13:05:40 [Note] InnoDB: Doublewrite buffer not found: creating new
141217 13:05:40 [Note] InnoDB: Doublewrite buffer created
141217 13:05:40 [Note] InnoDB: 128 rollback segment(s) are active.
141217 13:05:40 [Warning] InnoDB: Creating foreign key constraint system tables.
141217 13:05:40 [Note] InnoDB: Foreign key constraint system tables created
141217 13:05:40 [Note] InnoDB: Creating tablespace and datafile system tables.
141217 13:05:40 [Note] InnoDB: Tablespace and datafile system tables created.
141217 13:05:40 [Note] InnoDB: Waiting for purge to start
141217 13:05:40 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.21-70.0 started; log sequence number 0
141217 13:05:40 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
141217 13:05:40 [Note] InnoDB: FTS optimize thread exiting.
141217 13:05:40 [Note] InnoDB: Starting shutdown...
141217 13:05:42 [Note] InnoDB: Shutdown completed; log sequence number 1616697
OK
Filling help tables...
141217 13:05:42 [Note] InnoDB: Using mutexes to ref count buffer pool pages
141217 13:05:42 [Note] InnoDB: The InnoDB memory heap is disabled
141217 13:05:42 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
141217 13:05:42 [Note] InnoDB: Memory barrier is not used
141217 13:05:42 [Note] InnoDB: Compressed tables use zlib 1.2.7
141217 13:05:42 [Note] InnoDB: Using Linux native AIO
141217 13:05:42 [Note] InnoDB: Not using CPU crc32 instructions
141217 13:05:42 [Note] InnoDB: Initializing buffer pool, size = 256.0M
141217 13:05:42 [Note] InnoDB: Completed initialization of buffer pool
141217 13:05:42 [Note] InnoDB: Highest supported file format is Barracuda.
141217 13:05:42 [Note] InnoDB: 128 rollback segment(s) are active.
141217 13:05:42 [Note] InnoDB: Waiting for purge to start
141217 13:05:42 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.21-70.0 started; log sequence number 1616697
141217 13:05:43 [Note] InnoDB: FTS optimize thread exiting.
141217 13:05:43 [Note] InnoDB: Starting shutdown...
141217 13:05:44 [Note] InnoDB: Shutdown completed; log sequence number 1616707
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h 9684dc621284 password 'new-password'

Alternatively you can run:
'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from
SkySQL Ab. You can contact us about this at sales@skysql.com.
Alternatively consider joining our community based development effort:
http://mariadb.com/kb/en/contributing-to-the-mariadb-project/

141217 13:05:44 [Note] InnoDB: Using mutexes to ref count buffer pool pages
141217 13:05:44 [Note] InnoDB: The InnoDB memory heap is disabled
141217 13:05:44 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
141217 13:05:44 [Note] InnoDB: Memory barrier is not used
141217 13:05:44 [Note] InnoDB: Compressed tables use zlib 1.2.7
141217 13:05:44 [Note] InnoDB: Using Linux native AIO
141217 13:05:44 [Note] InnoDB: Not using CPU crc32 instructions
141217 13:05:44 [Note] InnoDB: Initializing buffer pool, size = 256.0M
141217 13:05:44 [Note] InnoDB: Completed initialization of buffer pool
141217 13:05:44 [Note] InnoDB: Highest supported file format is Barracuda.
141217 13:05:45 [Note] InnoDB: 128 rollback segment(s) are active.
141217 13:05:45 [Note] InnoDB: Waiting for purge to start
141217 13:05:45 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.21-70.0 started; log sequence number 1616707
141217 13:05:45 [Note] Plugin 'FEEDBACK' is disabled.
141217 13:05:45 [Note] Server socket created on IP: '::'.
141217 13:05:45 [Note] Event Scheduler: Loaded 0 events
141217 13:05:45 [Note] Reading of all Master_info entries succeded
141217 13:05:45 [Note] Added new Master_info '' to hash table
141217 13:05:45 [Note] mysqld: ready for connections.
Version: '10.0.15-MariaDB-1~wheezy-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
mitchellh commented 9 years ago

args should be an array I believe. Tagging as a bug to fix validation more.

mitchellh commented 9 years ago

Fixed!