2015年9月3日 星期四

[ 常見問題 ] How to flatten an image with 127 parents

Source From Here
Question
Newbie question: if I've managed to make an image with 127 layers (I know, bad form), is there a way to flatten it?

It seems like most solutions require making a container as the first step, but since I'm already at 127 layers in my image, I can't do that. When I try to I get an error ""Error response from daemon: Cannot create container with more than 127 parents"

How-To
You can flatten an image with docker export and then docker import. That will take all the existing layers and export them as a single file system image, in a tarball. Then import will bring it back in again as an image.
Steps:
1. docker run --name mycontainer image to create a container (the container name mycontainer is just an example)
2. docker export --output=mycontainer.tar mycontainer the container to a tarball (mycontainer.tar is just an example)
3. cat mycontainer.tar | docker import - mynewimage:imported the tarball (the image name mynewimage:imported is just an example)


沒有留言:

張貼留言

[ Java 文章收集 ] 局部敏感哈希 (Locality-Sensitive Hashing, LSH) 方法介紹

Source From  Here   Preface   本文主要介紹一種用於海量高維數據的近似最近鄰快速查找技術—— 局部敏感哈希  ( Locality-Sensitive Hashing, LSH ),內容包括了 LSH 的原理、LSH 哈希函數集、以及 LSH 的一...