+++ b/container/osimage/centos-7/build
Please follow container/ convention: this script should be "run" not "build".
pull_docker() code should be content of build.
@@ -0,0 +1,29 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+. ${CCI_SRC}/container/osimage/centos-7/bin/lib
centos-7 is too specific.
Please move code here.
+. ${CCI_SRC}/container/defconfig.sh
+check_passwd_file "$root_pwd_file"
$root_pwd_file is a local var in check_passwd_file(), not set here. check_passwd_file() => load_root_password()
+DIR=$(dirname $(realpath $0)) +cmd=(
- docker run
- --name init_docker
- -v $DIR/bin/:/root/bin
- -v /srv/initrd/modules/:/root/modules:ro
- -e ROOT_NEW_PASSWD=$ROOT_NEW_PASSWD
- -e image_name=$image_name
- $image
- /root/bin/create-image
+)
+pull_docker
+docker_rm init_docker +${cmd[@]}
+docker cp -a init_docker:/${image_name} ./
./ is where?
+echo "build finished!!!"
No !!! please.
Call docker_rm() here?
Thanks, Fengguang