diff --git a/datacenter/ucp/2.0/guides/applications/deploy-app-cli.md b/datacenter/ucp/2.0/guides/applications/deploy-app-cli.md index 5a19424904e..1420905a946 100644 --- a/datacenter/ucp/2.0/guides/applications/deploy-app-cli.md +++ b/datacenter/ucp/2.0/guides/applications/deploy-app-cli.md @@ -1,23 +1,21 @@ --- title: Deploy an app from the CLI -description: Learn how to deploy containerized applications on a cluster, with Docker +description: Learn how to deploy containerized applications on a swarm, with Docker Universal Control Plane. keywords: - deploy, application --- -# Deploy an app from the CLI - With Docker Universal Control Plane you can deploy your apps from the CLI, using Docker Compose. In this example we're going to deploy a WordPress application. ## Get a client certificate bundle -Docker UCP secures your cluster with role-based access control, so that only -authorized users can deploy applications to the cluster. To be able to run -Docker commands on the UCP cluster, you need to authenticate your requests using -client certificates. +Docker UCP secures your Docker swarm with role-based access control, so that only +authorized users can deploy applications. To be able to run +Docker commands on a swarm managed by UCP, you need to authenticate your +requests using client certificates. [Learn how to set your CLI to use client certificates](../access-ucp/cli-based-access.md). @@ -25,26 +23,39 @@ client certificates. The WordPress application we're going to deploy is composed of two services: -* wordpress: The container that runs Apache, PHP, and WordPress. +* wordpress: The service that runs Apache, PHP, and WordPress. * db: A MariaDB database used for data persistence. - - After setting up your terminal to authenticate using client certificates, create a file named `docker-compose.yml` with the following service definition: -```yml -wordpress: - image: wordpress - links: - - db:mysql - ports: - - 8080:80 - -db: - image: mariadb - environment: - MYSQL_ROOT_PASSWORD: example +```none +version: '2' + +services: + db: + image: mysql:5.7 + volumes: + - db_data:/var/lib/mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: wordpress + MYSQL_DATABASE: wordpress + MYSQL_USER: wordpress + MYSQL_PASSWORD: wordpress + + wordpress: + depends_on: + - db + image: wordpress:latest + ports: + - "8000:80" + restart: always + environment: + WORDPRESS_DB_HOST: db:3306 + WORDPRESS_DB_PASSWORD: wordpress +volumes: + db_data: ``` In your command line, navigate to the place where you've created the @@ -62,11 +73,11 @@ $ docker-compose --project-name wordpress ps Name Command State Ports ------------------------------------------------------------------------------------------ -wordpress_db_1 docker-entrypoint.sh mysqld Up 3306/tcp -wordpress_wordpress_1 /entrypoint.sh apache2-for ... Up 192.168.99.106:8080->80/tcp +wordpress_db_1 docker-entrypoint.sh mysqld Up 3306/tcp +wordpress_wordpress_1 docker-entrypoint.sh apach ... Up 172.31.18.153:8000->80/tcp ``` -In this example, WordPress can be accessed at 192.168.99.106:8080. Navigate to +In this example, WordPress can be accessed at 172.31.18.153:8000. Navigate to this address in your browser, to start using the WordPress app you just deployed. diff --git a/datacenter/ucp/2.0/guides/applications/index.md b/datacenter/ucp/2.0/guides/applications/index.md index a0bc820d2fd..8bf24961fe9 100644 --- a/datacenter/ucp/2.0/guides/applications/index.md +++ b/datacenter/ucp/2.0/guides/applications/index.md @@ -7,40 +7,51 @@ keywords: --- With Docker Universal Control Plane you can deploy applications from the -UI. You can define your application on the UI, or import an existing -docker-compose.yml file. - -In this example, we're going to deploy a WordPress application. +UI using `docker-compose.yml` files. In this example, we're going to deploy a +WordPress application. ## Deploy WordPress On your browser, **log in** to UCP, and navigate to the **Applications** page. -There, click the **Compose Application** button, to deploy a new application. +There, click the **Deploy compose.yml** button, to deploy a new application. ![](../images/deploy-app-ui-1.png) The WordPress application we're going to deploy is composed of two services: -* wordpress: The container that runs Apache, PHP, and WordPress. +* wordpress: The service that runs Apache, PHP, and WordPress. * db: A MariaDB database used for data persistence. - - -```yml -wordpress: - image: wordpress - links: - - db:mysql - ports: - - 8080:80 - -db: - image: mariadb - environment: - MYSQL_ROOT_PASSWORD: example +```none +version: '2' + +services: + db: + image: mysql:5.7 + volumes: + - db_data:/var/lib/mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: wordpress + MYSQL_DATABASE: wordpress + MYSQL_USER: wordpress + MYSQL_PASSWORD: wordpress + + wordpress: + depends_on: + - db + image: wordpress:latest + ports: + - "8000:80" + restart: always + environment: + WORDPRESS_DB_HOST: db:3306 + WORDPRESS_DB_PASSWORD: wordpress +volumes: + db_data: ``` -Copy-paste the application definition to UCP, and name it 'wordpress'. +Name the application 'wordpress', and paste the docker-compose.yml definition. You can also upload a docker-compose.yml file from your machine, by clicking on the 'Upload an existing docker-compose.yml' link. @@ -58,7 +69,7 @@ exposing. ![](../images/deploy-app-ui-4.png) -In this example, WordPress can be accessed at `192.168.99.106:8080`. +In this example, WordPress can be accessed at `172.31.18.152:8000`. Navigate to this address in your browser, to start using the WordPress app you just deployed. @@ -67,9 +78,9 @@ just deployed. ## Limitations -There are some limitations when deploying application on the UI. You can't -reference any external files, so the following Docker Compose keywords are not -supported: +There are some limitations when deploying docker-compose.yml applications from +the UI. You can't reference any external files, so the following Docker +Compose keywords are not supported: * build * dockerfile diff --git a/datacenter/ucp/2.0/guides/images/deploy-app-cli-1.png b/datacenter/ucp/2.0/guides/images/deploy-app-cli-1.png index ec2cf58a72c..9ccf43e4d4c 100644 Binary files a/datacenter/ucp/2.0/guides/images/deploy-app-cli-1.png and b/datacenter/ucp/2.0/guides/images/deploy-app-cli-1.png differ diff --git a/datacenter/ucp/2.0/guides/images/deploy-app-ui-1.png b/datacenter/ucp/2.0/guides/images/deploy-app-ui-1.png index b6d8d104e38..261b23b1e69 100644 Binary files a/datacenter/ucp/2.0/guides/images/deploy-app-ui-1.png and b/datacenter/ucp/2.0/guides/images/deploy-app-ui-1.png differ diff --git a/datacenter/ucp/2.0/guides/images/deploy-app-ui-2.png b/datacenter/ucp/2.0/guides/images/deploy-app-ui-2.png index cef96f86979..05e1564ed32 100644 Binary files a/datacenter/ucp/2.0/guides/images/deploy-app-ui-2.png and b/datacenter/ucp/2.0/guides/images/deploy-app-ui-2.png differ diff --git a/datacenter/ucp/2.0/guides/images/deploy-app-ui-3.png b/datacenter/ucp/2.0/guides/images/deploy-app-ui-3.png index 8fbc0683208..c81e945fce7 100644 Binary files a/datacenter/ucp/2.0/guides/images/deploy-app-ui-3.png and b/datacenter/ucp/2.0/guides/images/deploy-app-ui-3.png differ diff --git a/datacenter/ucp/2.0/guides/images/deploy-app-ui-4.png b/datacenter/ucp/2.0/guides/images/deploy-app-ui-4.png index dd633d3d4df..67e4daaab83 100644 Binary files a/datacenter/ucp/2.0/guides/images/deploy-app-ui-4.png and b/datacenter/ucp/2.0/guides/images/deploy-app-ui-4.png differ diff --git a/datacenter/ucp/2.0/guides/images/deploy-app-ui-5.png b/datacenter/ucp/2.0/guides/images/deploy-app-ui-5.png index ec2cf58a72c..318db9d1ca0 100644 Binary files a/datacenter/ucp/2.0/guides/images/deploy-app-ui-5.png and b/datacenter/ucp/2.0/guides/images/deploy-app-ui-5.png differ diff --git a/datacenter/ucp/2.0/guides/images/deploy-app-ui-6.png b/datacenter/ucp/2.0/guides/images/deploy-app-ui-6.png index ddde9be9f5f..274918c7879 100644 Binary files a/datacenter/ucp/2.0/guides/images/deploy-app-ui-6.png and b/datacenter/ucp/2.0/guides/images/deploy-app-ui-6.png differ