In the Carina Control Panel (the other tab), sign up for Carina.
⭐️ You only get one chance to enter your email address and password so be exact! ⭐️
Click Add Cluster and name it mycluster
In the Carina Control Panel (the other tab)
- Click your username in the top-right corner
- Click API Key
- Copy the API Key (Command-C)
In the terminal below
Set your environment variables to contain these credentials
$ export CARINA_USERNAME=<email>
$ export CARINA_APIKEY=<apikey>
$ eval $(carina env mycluster)
$ carina ls
ClusterName Flavor Nodes AutoScale Status
mycluster container1-4G 1 false active
In the terminal below
$ dvm use
Now using Docker 1.11.1
Run a WordPress blog with a MySQL database on an overlay network.
-
Create a network to connect your containers.
$ docker network create mynetwork ec98e17a760b82b5c0857e2e0d561019af67ef790170fac8413697d5ee183288
-
Run a MySQL instance in a container.
$ docker run --detach \ --name mysql \ --net mynetwork \ --env MYSQL_ROOT_PASSWORD=my-root-pw \ mysql:5.6 ab8ca480c46d10143217c0ee323f8420b6ab93737033c937c2f4dbf8578435bb
-
Run a WordPress instance in a container.
$ 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 6770c91929409196976f5ad30631b0f2836cd3d888c39bb3e322e0f60ca7eb18
-
Verify that your run was successful by viewing your running containers.
$ docker ps -n=2 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 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 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
-
View your WordPress site
$ open http://$(docker port wordpress 80)
-
(Optional) Remove your WordPress site.
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.
$ docker rm --force --volumes wordpress mysql wordpress mysql
-
Run
source ~/cleanup.env