Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ipgallery
/
devops
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
abce1372
authored
Jul 20, 2017
by
amir
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add new scripts
parent
1d827472
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
docker/script/compressRuningContainers.sh
docker/script/decompressContainers.sh
docker/script/compressRuningContainers.sh
0 → 100755
View file @
abce1372
#!/bin/bash
gzfile
=
"containers.tar"
gzcmpfile
=
$gzfile
gzcmpfile+
=
".gz"
rm
"
$gzcmpfile
"
touch
"
$gzfile
"
while
read
-r
line
;
do
name
=
$(
echo
"
$line
"
| sed
-r
's/[.:/]+/_/g'
)
echo
"Processing
$line
"
name+
=
".tar"
docker save
-o
"
$name
"
"
$line
"
tar
rvf
"
$gzfile
"
"
$name
"
rm
"
$name
"
done
< <
(
docker ps | awk
'{print $2}'
|
grep
-v
ID
)
echo
"gzipping..."
gzip
"
$gzfile
"
echo
"cleaning..."
#rm "$gzfile"
\ No newline at end of file
docker/script/decompressContainers.sh
0 → 100755
View file @
abce1372
#!/bin/bash
tarfile
=
"containers.tar"
gzcmpfile
=
$tarfile
gzcmpfile+
=
".gz"
gunzip
"
$gzcmpfile
"
tar
xvf
"
$tarfile
"
rm
"
$tarfile
"
while
read
-r
line
;
do
echo
"extracting image from
$line
"
docker load
--input
"
$line
"
rm
"
$line
"
done
< <
(
ls
-l
*
.tar | awk
'{print $9}'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment