Uploaded on Jan 4, 2020
Deploy Docker containers in Google Cloud Platform
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 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. 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 In the case of Facebox, we also need to include the MB_KEY environment variable, which we can do in this file: FROM machinebox/facebox ENV MB_KEY=YOUR_KEY_HERE app.yaml: The app.yaml file is where we will configure the deployment. runtime: custom env: flex service: default threadsafe: yes network: forwarded_ports: - 80:8080 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 # volumes: # - name: ramdisk1 # volume_type: tmpfs # size_gb: 0.5 This 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 v1 After a while, the image will be deployed and available. Go to https://saved project name/ to access the image. Introducing Machine Box: 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. 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 Thank you www.visualpath.in
Comments