File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,7 @@ function docker_save_image() {
19
19
local output_dir=" $2 "
20
20
local output_file=" ${output_dir} /$( echo " ${image} " | tr ' /' ' -' ) "
21
21
22
- docker save -o " ${output_file} " " ${image} "
23
- }
24
-
25
- function docker_load_image() {
26
- local image_file=" $1 "
27
- local socket_location=" $2 "
28
-
29
- sudo -E DOCKER_HOST=unix://" ${socket_location} " docker load -i " ${image_file} "
22
+ docker save -o " ${output_file} " .tar " ${image} "
30
23
}
31
24
32
25
function docker_pull_image() {
@@ -73,7 +66,7 @@ function main() {
73
66
# will change the permissions of the bind mount directory (images/) to root.
74
67
echo -e " Starting DinD container"
75
68
echo -e " -----------------------"
76
- docker run -d --privileged --name " ${dind_container} " -v ${PWD} /docker:/run -v ${PWD} /images/:/var/lib/docker-embedded/ -d " ${dind_container_image} "
69
+ docker run -d --privileged --name " ${dind_container} " -v " ${PWD} /images_tar " :/images_tar -v " ${PWD} " /images/:/var/lib/docker-embedded/ -d " ${dind_container_image} "
77
70
78
71
# wait until the docker daemon is ready
79
72
until docker exec " ${dind_container} " docker info & > /dev/null; do
@@ -90,7 +83,8 @@ function main() {
90
83
91
84
# Load the images
92
85
for image_file in " ${output_dir} " /* ; do
93
- docker_load_image " ${image_file} " " ${PWD} /docker/docker.sock"
86
+ echo -e " Loading image: ${image_file} "
87
+ docker exec " ${dind_container} " docker load -i " /images_tar/$( basename ${image_file} ) "
94
88
done
95
89
96
90
# clean up tar files
You can’t perform that action at this time.
0 commit comments