Advertisement
Guest User

Untitled

a guest
May 30th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. ### Sign up for Carina
  2.  
  3. In the Carina Control Panel (the other tab), sign up for Carina.
  4.  
  5. **You only get one chance to enter your email address and password** so be exact!
  6.  
  7. ### Create your cluster
  8.  
  9. Click **Add Cluster** and name it mycluster
  10.  
  11. ### Get your API Key
  12.  
  13. In the Carina Control Panel (the other tab)
  14.  
  15. 1. Click your username in the top-right corner
  16. 1. Click **API Key**
  17. 1. Copy the API Key (Command-C)
  18.  
  19. ### Configure and use the Carina CLI
  20.  
  21. In the terminal below
  22.  
  23. Set your environment variables to contain these credentials
  24.  
  25. ```bash
  26. $ export CARINA_USERNAME=firstname.lastname@example.com
  27. $ export CARINA_APIKEY=ddd1233abcdef4a0bc5da6789123ab45c
  28.  
  29. $ eval $(carina env mycluster)
  30.  
  31. $ carina ls
  32. ClusterName Flavor Nodes AutoScale Status
  33. mycluster container1-4G 1 false active
  34. ```
  35.  
  36. ### Configure and use the Docker CLI
  37.  
  38. In the terminal below
  39.  
  40. ```bash
  41. $ dvm use
  42. Now using Docker 1.11.1
  43. ```
  44.  
  45. ### Run your first application
  46.  
  47. Run a WordPress blog with a MySQL database on an overlay network.
  48.  
  49. 1. Create a network to connect your containers.
  50.  
  51. ```bash
  52. $ docker network create mynetwork
  53. ec98e17a760b82b5c0857e2e0d561019af67ef790170fac8413697d5ee183288
  54. ```
  55.  
  56. 1. Run a MySQL instance in a container.
  57.  
  58. ```bash
  59. $ docker run --detach --name mysql --net mynetwork --env MYSQL_ROOT_PASSWORD=my-root-pw mysql:5.6
  60. ab8ca480c46d10143217c0ee323f8420b6ab93737033c937c2f4dbf8578435bb
  61. ```
  62.  
  63. 1. Run a WordPress instance in a container.
  64.  
  65. ```bash
  66. $ docker run --detach --name wordpress --net mynetwork --publish 80:80 --env WORDPRESS_DB_HOST=mysql --env WORDPRESS_DB_PASSWORD=my-root-pw wordpress:4.4
  67. 6770c91929409196976f5ad30631b0f2836cd3d888c39bb3e322e0f60ca7eb18
  68. ```
  69.  
  70. 1. Verify that your run was successful by viewing your running containers.
  71.  
  72. ```bash
  73. $ docker ps -n=2
  74. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  75. 6770c9192940 wordpress:4.4 "/entrypoint.sh apach" About a minute ago Up About a minute 104.130.0.124:80->80/tcp 57d513b9-ed36-487d-8415-4ac65b6d41a8-n1/wordpress
  76. ab8ca480c46d mysql:5.6 "/entrypoint.sh mysql" 6 minutes ago Up 6 minutes 3306/tcp 57d513b9-ed36-487d-8415-4ac65b6d41a8-n1/mysql,57d513b9-ed36-487d-8415-4ac65b6d41a8-n1/wordpress/mysql
  77. ```
  78.  
  79. 1. View your WordPress site by running the following command and pasting the result into the address bar of a browser.
  80.  
  81. ```bash
  82. $ docker port wordpress 80
  83. 104.130.0.124:80
  84. ```
  85.  
  86. 1. *(Optional)* Remove your WordPress site.
  87.  
  88. If you aren't going to use your WordPress site, we recommend that you remove it. Doing so removes both your WordPress and MySQL containers. This will delete any data and any posts you've made in the WordPress site.
  89.  
  90. ```bash
  91. $ docker rm --force --volumes wordpress mysql
  92. wordpress
  93. mysql
  94. ```
  95.  
  96. 1. Run `source ~/cleanup.env`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement