From 1d8fbfb1c1c2210cd1152b5826b1c43a26c436ec Mon Sep 17 00:00:00 2001 From: Phuong Cao Date: Thu, 18 Feb 2016 14:44:41 -0600 Subject: [PATCH] Minor fixes --- README.org | 16 ++++++++++++++-- build_image.sh | 7 ++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/README.org b/README.org index a09585b..2a20b05 100644 --- a/README.org +++ b/README.org @@ -32,11 +32,13 @@ Three required parameters are: Example usage: #+begin_src sh -docker run -t --rm --privileged \ +$ docker run -t --rm --privileged \ -v /tmp/timemachine/:/tmp/timemachine/ \ csldepend/timemachine \ jessie \ 20151231 + +Image created! Import by: docker import /tmp/timemachine/jessie-20151231.tar jessie:20151231 #+end_src The resulting docker image =jessie-20151231.tar= is stored in a mounted @@ -48,7 +50,17 @@ host>:/tmp/timemachine/= (Don't modify the part after the colon!). Example usage: #+begin_src sh -docker import /tmp/timemachine/jessie-20151231.tar jessie:20151231 +$ docker import /tmp/timemachine/jessie-20151231.tar jessie:20151231 + +386ab9361803666d1bb592b7970f784f9faba6cd0f367aa3ad277762f8476e80 +#+end_src + +** Run the created image + +#+begin_src sh +$ docker run -ti jessie:20151231 cat /etc/apt/sources.list + +deb http://snapshot.debian.org/archive/debian/20151231T000000Z jessie main #+end_src * Contributors diff --git a/build_image.sh b/build_image.sh index aa3bf20..20a5af4 100755 --- a/build_image.sh +++ b/build_image.sh @@ -13,7 +13,8 @@ distribution=$1 datetime=$2 # create image using debootstrap -mkdir -p tmp_dir && cd tmp_dir && \ +cd $tmp_dir && \ debootstrap $distribution ${distribution}-${datetime} http://snapshot.debian.org/archive/debian/${datetime}T000000Z/ && \ -tar cvf ${distribution}-${datetime}.tar ${distribution}-${datetime}/* && \ -echo "Image created! Import by: \n docker import $tmp_dir/${distribution}-${datetime}.tar ${distribution}:${datetime}" +cd ${distribution}-${datetime} && tar cvf ${distribution}-${datetime}.tar * && \ +mv ${distribution}-${datetime}.tar .. && \ +echo "Image created! Import by: docker import $tmp_dir/${distribution}-${datetime}.tar ${distribution}:${datetime}"