From 94738ea7a5dcc7fc3ae965c5bd59b20fd39bec42 Mon Sep 17 00:00:00 2001 From: haoshuwei Date: Fri, 14 Feb 2020 18:30:53 +0800 Subject: [PATCH] add hotfix Signed-off-by: haoshuwei --- .gitignore | 1 + ack-centos.json | 3 +- ...ack-centos-using-existing-vpc-vswitch.json | 3 +- examples/ack-centos.json | 3 +- hotfix/hotfix-issue-19/README.md | 8 +++++ .../hotfix-issue-19/ack-centos-issue-19.json | 34 +++++++++++++++++++ .../scripts/updateContainerd.sh | 7 ++++ .../hotfix-issue-19/scripts/updateSystemd.sh | 3 ++ 8 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 hotfix/hotfix-issue-19/README.md create mode 100644 hotfix/hotfix-issue-19/ack-centos-issue-19.json create mode 100755 hotfix/hotfix-issue-19/scripts/updateContainerd.sh create mode 100755 hotfix/hotfix-issue-19/scripts/updateSystemd.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/ack-centos.json b/ack-centos.json index 1ab37a3..50309e4 100644 --- a/ack-centos.json +++ b/ack-centos.json @@ -2,7 +2,7 @@ "variables": { "region": "cn-hangzhou", "image_name": "test_image{{timestamp}}", - "source_image": "centos_7_06_64_20G_alibase_20190711.vhd", + "source_image": "centos_7_06_64_20G_alibase_20190619.vhd", "instance_type": "ecs.g6.large", "access_key": "{{env `ALICLOUD_ACCESS_KEY`}}", "secret_key": "{{env `ALICLOUD_SECRET_KEY`}}" @@ -17,6 +17,7 @@ "source_image": "{{user `source_image`}}", "ssh_username": "root", "instance_type": "{{user `instance_type`}}", + "skip_image_validation": "true", "io_optimized": "true" } ], diff --git a/examples/ack-centos-using-existing-vpc-vswitch.json b/examples/ack-centos-using-existing-vpc-vswitch.json index ccc2bb1..5737081 100644 --- a/examples/ack-centos-using-existing-vpc-vswitch.json +++ b/examples/ack-centos-using-existing-vpc-vswitch.json @@ -2,7 +2,7 @@ "variables": { "region": "cn-hangzhou", "image_name": "test_image{{timestamp}}", - "source_image": "centos_7_06_64_20G_alibase_20190711.vhd", + "source_image": "centos_7_06_64_20G_alibase_20190619.vhd", "instance_type": "ecs.g6.large", "vpc_id": "vpc-xxxxxx", "vswitch_id": "vsw-xxxxxx", @@ -21,6 +21,7 @@ "instance_type": "{{user `instance_type`}}", "vpc_id": "{{user `vpc_id`}}", "vswitch_id": "{{user `vswitch_id`}}", + "skip_image_validation": "true", "io_optimized": "true" } ], diff --git a/examples/ack-centos.json b/examples/ack-centos.json index c3c6e24..50f17a4 100644 --- a/examples/ack-centos.json +++ b/examples/ack-centos.json @@ -2,7 +2,7 @@ "variables": { "region": "cn-hangzhou", "image_name": "test_image{{timestamp}}", - "source_image": "centos_7_06_64_20G_alibase_20190711.vhd", + "source_image": "centos_7_06_64_20G_alibase_20190619.vhd", "instance_type": "ecs.g6.large", "access_key": "{{env `ALICLOUD_ACCESS_KEY`}}", "secret_key": "{{env `ALICLOUD_SECRET_KEY`}}" @@ -17,6 +17,7 @@ "source_image": "{{user `source_image`}}", "ssh_username": "root", "instance_type": "{{user `instance_type`}}", + "skip_image_validation": "true", "io_optimized": "true" } ], diff --git a/hotfix/hotfix-issue-19/README.md b/hotfix/hotfix-issue-19/README.md new file mode 100644 index 0000000..a7f4de0 --- /dev/null +++ b/hotfix/hotfix-issue-19/README.md @@ -0,0 +1,8 @@ +This is the template for ack base image to fix issue [#19](https://github.com/AliyunContainerService/ack-image-builder/issues/19) + +Commands to build image: +``` +export ALICLOUD_ACCESS_KEY=XXX +export ALICLOUD_SECRET_KEY=XXX +packer build ack-centos-issue-19.json +``` \ No newline at end of file diff --git a/hotfix/hotfix-issue-19/ack-centos-issue-19.json b/hotfix/hotfix-issue-19/ack-centos-issue-19.json new file mode 100644 index 0000000..b072139 --- /dev/null +++ b/hotfix/hotfix-issue-19/ack-centos-issue-19.json @@ -0,0 +1,34 @@ +{ + "variables": { + "region": "cn-hangzhou", + "image_name": "test_image{{timestamp}}", + "source_image": "centos_7_06_64_20G_alibase_20190619.vhd", + "instance_type": "ecs.g6.large", + "access_key": "{{env `ALICLOUD_ACCESS_KEY`}}", + "secret_key": "{{env `ALICLOUD_SECRET_KEY`}}" + }, + "builders": [ + { + "type": "alicloud-ecs", + "access_key": "{{user `access_key`}}", + "secret_key": "{{user `secret_key`}}", + "region": "{{user `region`}}", + "image_name": "{{user `image_name`}}", + "source_image": "{{user `source_image`}}", + "ssh_username": "root", + "instance_type": "{{user `instance_type`}}", + "skip_image_validation": "true", + "io_optimized": "true" + } + ], + "provisioners": [ + { + "type": "shell", + "scripts": [ + "scripts/updateSystemd.sh", + "scripts/updateContainerd.sh" + ], + "expect_disconnect": true + } + ] +} diff --git a/hotfix/hotfix-issue-19/scripts/updateContainerd.sh b/hotfix/hotfix-issue-19/scripts/updateContainerd.sh new file mode 100755 index 0000000..9d085bc --- /dev/null +++ b/hotfix/hotfix-issue-19/scripts/updateContainerd.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +curl -LO https://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/daemon-build/centos/containerd.io-1.2.10-3.2.el7.x86_64.rpm containerd.io-1.2.10-3.2.el7.x86_64.rpm + +yum localinstall -y containerd.io-1.2.10-3.2.el7.x86_64.rpm + +rm -rf containerd.io-1.2.10-3.2.el7.x86_64.rpm \ No newline at end of file diff --git a/hotfix/hotfix-issue-19/scripts/updateSystemd.sh b/hotfix/hotfix-issue-19/scripts/updateSystemd.sh new file mode 100755 index 0000000..7a42060 --- /dev/null +++ b/hotfix/hotfix-issue-19/scripts/updateSystemd.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +yum install -y systemd-219-67.el7_7.3.x86_64 \ No newline at end of file