官术网_书友最值得收藏!

  • Learning DevOps
  • Mikael Krief
  • 131字
  • 2021-06-24 12:32:15

Installing Packer by script on Linux

The installation script for a Linux machine is as follows:

PACKER_VERSION="1.4.3" #Update with your desired version

curl -Os https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip \
&& curl -Os https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_SHA256SUMS \
&& curl https://keybase.io/hashicorp/pgp_keys.asc | gpg --import \
&& curl -Os https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_SHA256SUMS.sig \
&& gpg --verify packer_${PACKER_VERSION}_SHA256SUMS.sig packer_${PACKER_VERSION}_SHA256SUMS \
&& shasum -a 256 -c packer_${PACKER_VERSION}_SHA256SUMS 2>&1 | grep "${PACKER_VERSION}_linux_amd64.zip:\sOK" \
&& unzip -o packer_${PACKER_VERSION}_linux_amd64.zip -d /usr/local/bin

This script performs the following actions:

  1. Download the Packer version 1.4.0 package and check the checksum.
  2. Unzip and copy the package into a local directory, /usr/local/bin (by default, this folder is in the PATH environment variable).

The following is a screenshot of the execution of the script for installing Packer on Linux:

主站蜘蛛池模板: 渑池县| 西贡区| 乐业县| 喜德县| 玉田县| 和龙市| 南川市| 遂宁市| 获嘉县| 乌拉特后旗| 江安县| 双桥区| 邛崃市| 德惠市| 莱西市| 来安县| 太原市| 无为县| 故城县| 台州市| 青神县| 黄龙县| 宣恩县| 疏勒县| 兴海县| 晋中市| 虎林市| 罗江县| 牙克石市| 安多县| 多伦县| 兖州市| 虞城县| 通山县| 龙里县| 黔东| 邻水| 东阿县| 乐安县| 靖西县| 浦东新区|