deploy docker containers in google cloud platform

13
Deploy Docker containers in Google Cloud Platform

Upload: vishnupriya.visualpath

Post on 04-Jan-2020

16 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Deploy Docker containers in Google Cloud Platform

Deploy Docker containers in Google Cloud Platform

Page 2: Deploy Docker containers in Google Cloud Platform

Delivering complex software solutions inside a neat container is exactly what Docker has promised, and Machine Box has really benefited. This article shows you how to run Machine Box in Google Cloud Platform, but the technique works for any Docker image you want to deploy.

You will need:• Google Cloud SDK (gcloud command)• Your favorite text editor• A terminal

Page 3: Deploy Docker containers in Google Cloud Platform

1. Create an account and sign in: Go to the Google Cloud Platform Console and log in. You will need a Google account to accept certain terms and conditions, etc.

2. Create a project: From the projects drop-down list, select Create a new project. For new users, you will probably be guided to do so with an assistant.

Page 4: Deploy Docker containers in Google Cloud Platform
Page 5: Deploy Docker containers in Google Cloud Platform

Choose a project name and set up a billing account before clicking Create.While setting up your project, you can prepare it for deployment.

3. Your project files: Create a folder on your development machine, ideally corresponding to the name of the project you just created. Create two text files called app.yaml and Dockerfile.

Docker File: The Dockerfile describes the image you want to add. In the simplest distribution, simply specify the image you want to generate:

FROM machinebox/facebox

Page 6: Deploy Docker containers in Google Cloud Platform

In the case of Facebox, we also need to include the MB_KEY environment variable, which we can do in this file:

FROM machinebox/faceboxENV MB_KEY=YOUR_KEY_HERE

app.yaml: The app.yaml file is where we will configure the deployment.runtime: customenv: flexservice: defaultthreadsafe: yesnetwork:forwarded_ports:- 80:8080

Page 7: Deploy Docker containers in Google Cloud Platform

automatic_scaling: min_num_instances: 1 max_num_instances: 10 cool_down_period_sec: 120 # default value cpu_utilization: target_utilization: 0.5 resources: cpu: 1 memory_gb: 2 disk_size_gb: 10

Page 8: Deploy Docker containers in Google Cloud Platform

# volumes:# - name: ramdisk1# volume_type: tmpfs# size_gb: 0.5This file describes an automatic scaling image (between 1 and 10 instances at

a time) with a single processor, 2 GB of RAM and a 10 GB disk, transmitting port 8080 to 80 of the machine box (container) so that it is accessible on the Web.

4. Deploy: Deploy your first version with the following command line in the terminal:

gcloud app deploy app.yaml -v v1After a while, the image will be deployed and available.

Page 9: Deploy Docker containers in Google Cloud Platform

Go to https://saved project name/ to access the image.

Page 10: Deploy Docker containers in Google Cloud Platform

Introducing Machine Box:

Page 11: Deploy Docker containers in Google Cloud Platform

Machine Box puts state-of-the-art machine learning capabilities in Docker containers so developers like you can easily integrate natural language processing, facial detection, object recognition, and more. in your own applications very quickly. The boxes are designed for scale, so when your app really takes off, simply add other boxes horizontally, ad infinitum and beyond.

Page 12: Deploy Docker containers in Google Cloud Platform

For More Information on Google Cloud Platform Click Here

VisualPath Training Institute Address: Flat no:205, 2nd Floor,

Nilgiri Block, Aditya Enclave Ameerpet, Hyderabad

Contact: +91 9989971070

Page 13: Deploy Docker containers in Google Cloud Platform

Thank youwww.visualpath.in