Created
August 20, 2017 14:26
-
-
Save tef/4a7b5249fb1d86c9c4a550b590bcdc0b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
PID=`docker run -v $(pwd):/workdir -d --privileged -i --rm ubuntu /bin/bash` | |
docker exec $PID apt-get -q -y update | |
docker exec $PID apt-get -q -y install debootstrap | |
docker exec $PID debootstrap --arch amd64 xenial /rootfs http://archive.ubuntu.com/ubuntu | |
docker exec $PID cp -r /rootfs/ /workdir | |
echo exit | docker attach $PID | |
echo "Dockerfile" > rootfs/.dockerignore | |
echo "FROM scratch | |
ADD / ." > rootfs/Dockerfile | |
cd rootfs | |
docker build -t "rootfs" . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment