站长之家,中国草根站长新闻、建站经验、素材资源交流平台!
分类导航

站长新闻|网站运营|建站经验|网站优化|站长资源|站长源码|

服务器之家 - 站长之家 - 建站经验 - 在Google Container Engine上申请创建Docker容器

在Google Container Engine上申请创建Docker容器

2021-03-13 20:41CSDN Blog 建站经验

这篇文章主要介绍了在Google Container Engine上申请创建Docker容器,在国内使用的话要注意网络连通问题和外币信用卡或Paypal支付,需要的朋友可以参考下

(1)要申请一个google账户。
(2)激活google账单,即绑定支付信用卡,为使用google的服务买单。激活过程中为了验证信用卡是否可用,需要支付1美元的费用。
激活支付地址:https://console.developers.google.com/billing?_ga=1.62759852.1080048005.1441690490
支付激活后,可以看到能够使用的一些服务,同时看到可以免费使用60天。
在Google Container Engine上申请创建Docker容器

(3)激活google api
激活后,可以使用如下两种服务:
google container engine api
google compute engine and associated apis
创建一个gerry-test-proj工程:
在Google Container Engine上申请创建Docker容器

然后点击建立,会自动跳转到当前创建好的工程中:
在Google Container Engine上申请创建Docker容器

(4)安装gcloud

到google cloud sdk上可以下载到各个版本的客户端:https://cloud.google.com/sdk/#windows
安装方法也有说明。安装完成后,可以看下gcloud的使用方法:
 

复制代码

代码如下:


root@gerryyang:~# gcloud -h
usage: gcloud [optional flags] <group | command>
group may be auth | components | compute | config | container |
deployment-manager | dns | sql | topic
command may be docker | feedback | help | info | init | version

 
the *gcloud* cli manages authentication, local configuration, developer 
workflow, and interactions with the google cloud platform apis. 
 
optional flags: 
  --account account      google cloud platform user account to use for 
                         invocation. 
  --format format        format for printed output. 
  --help                 display detailed help. 
  --log-http log_http    logs all http server requests and responses to stderr. 
                         (true/false) 
  --project project_id   google cloud platform project id to use for this 
                         invocation. 
  --quiet, -q            disable all interactive prompts. 
  --trace-token trace_token 
                         token used to route traces of service requests for 
                         investigation of issues. 
  --user-output-enabled user_output_enabled 
                         control whether user intended output is printed to the 
                         console.  (true/false) 
  --verbosity verbosity  override the default verbosity for this command.  this 
                         must be a standard logging verbosity level: [debug, 
                         info, warning, error, critical, none] (default: 
                         [warning]). 
  -h                     print a summary help and exit. 
  -v, --version          print version information. 
 
command groups: 
  auth                   manage oauth2 credentials for the google cloud sdk. 
  components             list, install, update, or remove google cloud sdk 
                         components or packages. 
  compute                read and manipulate google compute engine resources. 
  config                 view and edit google cloud sdk properties. 
  container              deploy and manage clusters of machines for running 
                         containers. 
  deployment-manager     manage deployments of cloud resources. 
  dns                    manage your cloud dns managed-zones and record-sets. 
  sql                    manage cloud sql databases. 
  topic                  gcloud supplementary help. 
 
commands: 
  docker                 provides the docker cli access to the google container 
                         registry. 
  feedback               provide feedback to the google cloud sdk team. 
  help                   prints detailed help messages for the specified 
                         commands. 
  info                   display information about the current gcloud 
                         environment. 
  init                   create and initialize a gcloud workspace in the current 
                         directory. 
  version                print version information for cloud sdk components. 

 

然后使用gcloud登陆gcp账户(即,完成认证):
在Google Container Engine上申请创建Docker容器

后记
越来越多的公司开始使用容器来构建应用,它可以方便地实现扩展、复制以及升级。这个新服务提供了一种全新的途径来管理大量容器,免除了涉及到多容器业务流操作的大量底层工作。
google于2014年11月首次对外发布了容器引擎,不过只是预览版本。随着这次商业性的发布,google确保该服务已经具备好应对生产环境的各种条件,并承诺99.95%的正常运行时间。
另外,定价也已经确定。少于6个节点的用户可以免费使用,若需管理多于6个节点则需为每个集群支付$0.15/小时的费用。
google自身早已使用容器来运行internet服务,例如搜索和邮箱服务。
通过容器,公司可以让每个组件包含一部分应用,以模块化的方式构建它们的应用,这就是广为人知的微服务架构。当应用需要更新时,一个新的容器可以轻易地实现替换,以减小对操作的影响。
容器也为devops形式的软件开发创造了条件。这种情况下,开发者在开发应用时快速地迭代,通过在容器中打包,每个独立的组件都可以轻松地进行测试。
通过这个服务,用户在单次操作中,完成对多容器复杂应用的部署。gce会记录操作日志,以确保每个容器的正确运行,它也提供一条简易的途径,通过增加额外的处理器或内存,来调整集群的大小。

延伸 · 阅读

精彩推荐
  • 建站经验网站更换服务器有什么影响

    网站更换服务器有什么影响

    在我们日常维护 网站 的时候,可能会由于网站打开慢或者网站被攻击, 服务器 内部故障或者外部的原因都会导致我们的网站出现打不开的现象,有时我们...

    东德SEO4182020-12-04
  • 建站经验腾讯高手都在学的「感知性模式设计」是什么?

    腾讯高手都在学的「感知性模式设计」是什么?

    如果沿用到互联网方面的设计,那么感知性模式的例子可能包括:文字信息、版式、配色、布局、插图、图标、形状纹理、间距、交互或者动画等等,这些...

    优设7802021-08-03
  • 建站经验网站中了木马怎么办

    网站中了木马怎么办

    网站中了木马怎么办?网站被黑中了木马也不算是比较稀奇的事情,不过大多数人是遇不到的,一般出现这种情况的网站都是一些比较高端的企业网站,或者...

    站长之家4802021-09-24
  • 建站经验关于站内搜索分析的重要性和方法

    关于站内搜索分析的重要性和方法

    SEO!PPC!内容规划!转化率啊!?当我们殚精竭力、勤勤恳恳劳作,加以虔诚的态度,拜请到各位访客,可90%的人都洒脱的挥一挥衣袖不带走一 片云彩,让咱们这...

    建站教程网9312021-06-09
  • 建站经验网店运营要学会两条腿走路:网店设计和营销

    网店运营要学会两条腿走路:网店设计和营销

    百度重新收录淘宝店,对于运营淘宝店的店主们应该是一个好消息...

    开店教程网3162020-08-21
  • 建站经验网站建设初期的SEO优化定位

    网站建设初期的SEO优化定位

    根据 网站建设 的性质我们可以分为两种:一种是产品的商城,一种是做服务的网站。每一个网站在建设之前都会考虑行业的竞争对手的手法还有自身行业...

    站长之家9952021-01-28
  • 建站经验个人站长怎样选择做网站

    个人站长怎样选择做网站

    做网站是为了赚钱,我相信没人会反对,网站有了流量,才能赚钱,本篇文章将为大家介绍做站方向的取舍,使流量来的快,竞争小。 ...

    建站教程网5232020-09-03
  • 建站经验如何在百度知道发外链的技巧

    如何在百度知道发外链的技巧

    百度知道作为国内最大的互动问答平台,每天云集了数以千万计的访客,而且百度关键词搜索结果中,百度知道页面也有着不错的排名,这就让了不少站长...

    站长之家9192021-07-03