https://blogs.oracle.com/developers/announcing-packer-builder-for-oracle-cloud-infrastructure-classic
HashiCorp Packer 1.2.0 がOracle Cloud Infrastructure Classic上のイメージ構築をネイティブサポートするようになりました。
HashiCorp PackerPackerは、単一のソース構成から複数のプラットフォームにわたるマシンイメージを作成するためのオープンソースツールです。新しいoracle-classicbuilderを使用すると、oracle-oci Builderと同様に、直接Oracle Classic Compute上に新しいアプリケーション・イメージを構築できます。
https://www.packer.io/
Change Log : 1.2.0
https://github.com/hashicorp/packer/blob/master/CHANGELOG.md#120-february-9-2018
Oracle Cloud Infrastructure Classic Compute Builder新しいイメージは、Oracle提供の基本OSイメージ、既存のプライベート・イメージ、またはOracle Cloud Marketplaceからインストールされたイメージから作成できます。
https://www.packer.io/docs/builders/oracle-classic.html
Oracle Cloud Infrastructure (OCI) Builder
https://www.packer.io/docs/builders/oracle-oci.html
Oracle Cloud Marketplace(注意)
https://cloudmarketplace.oracle.com/marketplace/compute
PackerはVirtualBoxビルダーを使い、Oracle Cloud Infrastructure Classic互換のマシンイメージを作成することもできます。そしてこの方法は、新たなベースOSイメージをISOイメージから構築する場合に今なお有用です。詳細は以下をご覧ください。
Creating Oracle Compute Cloud Virtual Machine Images using Packer
https://blogs.oracle.com/cloudmarketplace/creating-oracle-compute-cloud-virtual-machine-images-using-packer
oracle-classic Builder Example
この例では、既存のUbuntuイメージをベースOSとして使用し、Redisをインストールした新たなイメージを作成します。packer構成ファイルを作成します(redis.json)。
Packerを実行してイメージを構築します。
{
"builders"
: [
{
"type"
:
"oracle-classic"
,
"username"
:
"user@example.com"
,
"password"
:
"PASSWORD"
,
"identity_domain"
:
"a12345678"
,
"shape"
:
"oc3"
,
"image_name"
:
"Redis_{{timestamp}}"
,
"source_image_list"
:
"/Compute-a12345678/user@example.com/Ubuntu.16.04.20180122.amd64"
,
"dest_image_list"
:
"Redis"
,
"image_description"
:
"Redis Image Built with Packer"
,
"ssh_username"
:
"opc"
,
}
],
"provisioners"
: [
{
"type"
:
"shell"
,
"inline"
: [
"sudo apt-get update"
,
"sudo apt-get install -y redis-server"
]
}
]
}
$ packer build redis.json

Packerの動作が完了後、新しいイメージがCompute Classicコンソールで利用可能になっており、新規インスタンスを立ち上げることができます。

See also
Oracle Cloud Infrastructureイメージ作成にあたっては、以下をご覧ください。- Oracle Cloud Infrastructure (OCI) Builder
https://www.packer.io/docs/builders/oracle-oci.html - Building OCI machine images with Packer
https://medium.com/oracledevs/building-oci-machine-images-with-packer-8f2f5ea66627
0 件のコメント:
コメントを投稿