MAC 安装 packer 1.7.2

MAC 安装 packer 1.7.2

1.创建目录并进入
$ mkdir -p $(go env GOPATH)/src/github.com/hashicorp && cd $_
2.下载源代码
$ git clone https://github.com/hashicorp/packer.git
3.切换到1.7.2发布版
$ git checkout 1f834e229aa722ea1279ec32503a2ea011f24e03
4.创建自己的分支
$ git switch -c yourname_dev
5.修改

当前项目目录下version/version.go 文件的第17行

const VersionPrerelease = "dev"
6.编译
$ make dev
7.编译完了之后

有两种做法,
1.修改系统环境变量。指向当前项目下刚生成的/bin/packer
2.将bin/packer复制到 /usr/local/bin/packer

8.新启一个终端
$ packer

出现下面字样算是安装成功

 Usage: packer [--version] [--help] <command> [<args>]

Available commands are:
    build           build image(s) from template
    console         creates a console for testing variable interpolation
    fix             fixes templates from old versions of packer
    fmt             Rewrites HCL2 config files to canonical format
    hcl2_upgrade    transform a JSON template into an HCL2 configuration
    init            Install missing plugins or upgrade plugins
    inspect         see components of a template
    validate        check that a template is valid
    version         Prints the Packer version
    ```


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值