• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

packer: Packer是一个开源工具,用于从单一配置来源为多平台创建相同的机器映像 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

packer

开源软件地址:

https://gitee.com/mirrors/packer

开源软件介绍:

Packer

Build StatusDiscussPkgGoDevGoReportCard

HashiCorp Packer logo

Packer is a tool for building identical machine images for multiple platformsfrom a single source configuration.

Packer is lightweight, runs on every major operating system, and is highlyperformant, creating machine images for multiple platforms in parallel. Packercomes out of the box with support for many platforms, the full list of which canbe found at https://www.packer.io/docs/builders.

Support for other platforms can be added via plugins.

The images that Packer creates can easily be turned intoVagrant boxes.

Quick Start

Note: There is a greatintroduction and getting started guidefor those with a bit more patience. Otherwise, the quick start belowwill get you up and running quickly, at the sacrifice of not explaining somekey points.

First, download a pre-built Packerbinary for your operating system orcompile Packeryourself.

After Packer is installed, create your first template, which tells Packerwhat platforms to build images for and how you want to build them. In ourcase, we'll create a simple AMI that has Redis pre-installed.

Save this file as quick-start.pkr.hcl. Export your AWS credentials as theAWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.

variable "access_key" {  type    = string  default = "${env("AWS_ACCESS_KEY_ID")}"}variable "secret_key" {  type      = string  default   = "${env("AWS_SECRET_ACCESS_KEY")}"  sensitive = true}locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }source "amazon-ebs" "quick-start" {  access_key    = "${var.access_key}"  ami_name      = "packer-example ${local.timestamp}"  instance_type = "t2.micro"  region        = "us-east-1"  secret_key    = "${var.secret_key}"  source_ami    = "ami-af22d9b9"  ssh_username  = "ubuntu"}build {  sources = ["source.amazon-ebs.quick-start"]}

Next, tell Packer to build the image:

$ packer build quick-start.pkr.hcl...

Packer will build an AMI according to the "quick-start" template. The AMIwill be available in your AWS account. To delete the AMI, you must manuallydelete it using the AWS console. Packerbuilds your images, it does not manage their lifecycle. Where they go, howthey're run, etc., is up to you.

Documentation

Comprehensive documentation is viewable on the Packer website at https://www.packer.io/docs.

Contributing to Packer

SeeCONTRIBUTING.mdfor best practices and instructions on setting up your development environmentto work on Packer.

Unmaintained Plugins

As contributors' circumstances change, development on a community maintainedplugin can slow. When this happens, HashiCorp may use GitHub's option to archive theplugin’s repository, to clearly signal the plugin's status to users.

What does unmaintained mean?

  1. The code repository and all commit history will still be available.
  2. Documentation will remain on the Packer website.
  3. Issues and pull requests are monitored as a best effort.
  4. No active development will be performed by HashiCorp.

If you are interested in maintaining an unmaintained or archived plugin, please reach out to us at [email protected].


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap