Update README.md

This commit is contained in:
Ettore Di Giacinto
2016-06-15 09:27:18 +02:00
committed by GitHub
parent a00d6ee919
commit a62dffc56a
+10 -27
View File
@@ -24,36 +24,19 @@ Ensure to have the daemon started and running:
sudo docker pull sabayon/spinbase-amd64
## Converting the image from Docker to use it with [Molecules](https://github.com/Sabayon/molecules)
## Converting the image from Docker to use it with [Molecules](https://github.com/Sabayon/molecules) as base chroot
### Only with undocker, without squashing the layers
Install [docker-companion](https://github.com/mudler/docker-companion) or download the pre-compiled version:
After pulling the docker image, install [undocker](https://github.com/larsks/undocker/) and then as root:
curl -s https://api.github.com/repos/mudler/docker-companion/releases/latest \
| grep "browser_download_url.*amd64" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -i - -O docker-companion
and then as root:
docker save sabayon/spinbase-amd64:latest | undocker -i -o spinbase sabayon/spinbase-amd64:latest
./docker-companion unpack sabayon/spinbase-amd64 /my/path
### Using [docker-squash](https://github.com/jwilder/docker-squash)
You can also squash the image with [docker-squash](https://github.com/jwilder/docker-squash) and then extract your layers.
sudo docker save sabayon/spinbase-amd64:latest | sudo TMPDIR=/dev/shm docker-squash -t sabayon/spinbase-amd64:squashed > /your/prefered/path/Spinbase.tar
You can replace /dev/shm with your prefered tmpdir
### With undocker, but squashing the layers
The squash can also been accomplished creating a container from the image, exporting it and then importing it back.
sudo docker run -t -i sabayon/spinbase-amd64:latest /bin/bash
$ exit # You should drop in a shell, exit, you should see a container id, otherwise find it :
sudo docker ps -l
sudo docker export <CONTAINER ID> | docker import - sabayon/spinbase-amd64:squashed
docker save sabayon/spinbase-amd64:squashed | undocker -i -o spinbase sabayon/spinbase-amd64:squashed
Docker will loose the history revision and then you can estract the layer, using as base for chroot.
You now have the tree on the *spinbase/* directory
If you are planning to use the resulting files as a chroot, don't forget to set a nameserver on resolv.conf file
echo "nameserver 208.67.222.222" > spinbase/etc/resolv.conf