+os_name="$(echo $DIR |awk -F "/" '{print $(NF - 2)}')"
| awk
Good.
+os_version="$(echo $DIR |awk -F "/" '{print $NF}')"
| awk
Good.
+docker_url="https://repo.openeuler.org/openEuler-$%7Bos_version%7D/docker_img/aarch64/op..." +docker_tar="openEuler-${os_version}-docker.aarch64.tar.xz" +image=$(echo "${os_name}-${os_version}" | tr '[A-Z]' '[a-z]')
if use /bin/bash, can echo ${os_name,,} to convert lowercase
Good.
- docker load -i "$HOME/$docker_tar"
add blank line here
Good.
Thanks, Chenglong
- if [ $? = 0 ]; then
echo "finish downloading image"
- else
echo "[ERROR] Pull docker image failed."
exit 1
- fi
+}
+docker_cp_image() +{
- docker cp -a init_docker:/tmp/${IMAGE_NAME} $HOME/
- echo "result: $(ls $HOME/${IMAGE_NAME})"
+}
2.23.0