Skip to content

Instantly share code, notes, and snippets.

@jeff1evesque
Last active July 5, 2016 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeff1evesque/a7d3cf872ab5f474ec76cd4aa2e0aa0c to your computer and use it in GitHub Desktop.
Save jeff1evesque/a7d3cf872ab5f474ec76cd4aa2e0aa0c to your computer and use it in GitHub Desktop.
Query database docker container via interactive bash
Running pre-create checks...
Creating machine...
(default) Copying C:\Users\Jeff\.docker\machine\cache\boot2docker.iso to C:\User
s\Jeff\.docker\machine\machines\default\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to configure a dhcp server. Somet
imes, such confirmation window is minimized in the taskbar.
(default) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this vi
rtual machine, run: C:\Program Files\Docker Toolbox\docker-machine.exe env defau
lt
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
docker is configured to use the default machine with IP 192.168.99.103
For help getting started, check out the docs at https://docs.docker.com
Start interactive shell
$ cd ~/web-projects/machine-learning
$ docker build -f docker/database.dockerfile -t container-database .
...
Removing intermediate container 71775f31d67f
Successfully built e484f9fbf2e3
SECURITY WARNING: You are building a Docker image from Windows against a non-Win
dows Docker host. All files and directories added to build context will have '-r
wxr-xr-x' permissions. It is recommended to double check and reset permissions f
or sensitive files and directories.
$ docker run --name database container-database
* Starting MariaDB database server mysqld
...done.
* Checking for corrupt, not cleanly closed and upgrade needing tables.
$ docker run -it database /bin/bash mysql
root@c5766e13f540:/# service mysql start
* Starting MariaDB database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
root@c5766e13f540:/# mysql -u root -p db_machine_learning
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 28
Server version: 5.5.49-MariaDB-1ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [db_machine_learning]> show tables;
+-------------------------------+
| Tables_in_db_machine_learning |
+-------------------------------+
| tbl_dataset_entity |
| tbl_feature_count |
| tbl_feature_value |
| tbl_model_type |
| tbl_observation_label |
+-------------------------------+
5 rows in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment