build/build.sh: support different template json file

Signed-off-by: Yilong Ren <yilong.ryl@alibaba-inc.com>
This commit is contained in:
Yilong Ren
2020-11-20 10:42:53 +08:00
parent 027e247d71
commit 3457f021ff
2 changed files with 5 additions and 3 deletions

View File

@@ -2,7 +2,6 @@ FROM alpine:3.10
ADD https://releases.hashicorp.com/packer/1.6.0/packer_1.6.0_linux_amd64.zip /packer_1.6.0_linux_amd64.zip
RUN unzip packer_1.6.0_linux_amd64.zip && mv packer /bin/packer
COPY examples/ack-kubernetes.json examples/ack-kubernetes.json
COPY scripts/init.sh scripts/init.sh
ENTRYPOINT ["packer", "build"]
ENTRYPOINT ["packer", "build"]

View File

@@ -17,6 +17,9 @@ kube_version=${KUBE_VERSION}"
exit 0
fi
file_path="$(pwd)/$1"
##build OS image
docker run -e ALICLOUD_ACCESS_KEY=$ACCESS_KEY -e ALICLOUD_SECRET_KEY=$SECRET_KEY -e REGION=$REGION -e KUBE_VERSION=$KUBE_VERSION \
-e DOCKER_VERSION=$DOCKER_VERSION registry.aliyuncs.com/acs/ack-image-builder:v1.0.0 $1
-e DOCKER_VERSION=$DOCKER_VERSION -v $file_path:$file_path registry.aliyuncs.com/acs/ack-image-builder:v1.0.0 $file_path