X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=docker%2FREADME.md;fp=docker%2FREADME.md;h=a2ca38fde11a6cae030dd622f8961c47360a82fc;hp=0000000000000000000000000000000000000000;hb=1239389195ada5f51435dc8d8476a71b88090092;hpb=395bf715f912ba18fefcd50795a0ff0e10d8dbb4 diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..a2ca38f --- /dev/null +++ b/docker/README.md @@ -0,0 +1,61 @@ +Purpose +------- + +Execute grml-debootstrap inside a docker container. +This is useful e.g. for developing new features, reproducing problems and writing tests in a clean and reproducible environment. + +Files +----- + +The Dockerfile is controlling the [automated builds at the Docker Hub Registry](https://registry.hub.docker.com/u/mika/grml-debootstrap/). + +The `*.bats` files are test scripts, used for verifying the Debian installations as generated by the `test*.sh` scripts. + +Usage instructions +------------------ + +Make sure the docker image generated by the Dockerfile is available on your system: + +```` +% docker pull mika/grml-debootstrap +```` + +Start a container instance and switch into it via e.g.: + +```` +% docker run -it --privileged=true mika/grml-debootstrap +```` + +*NOTE:* `--privileged=true` is required for usage with loop devices and mounting proc, sysfs etc inside the container + +*TIP:* add the `--rm` option to the command line to automatically remove the container when it exits + +Use grml-debootstrap inside the container, e.g.: + +* Install Debian inside a VM image: + +```` +# grml-debootstrap --vmfile --target /srv/debian.img --password grml --hostname docker [--force] +```` + +* Install Debian system in a directory: + +```` +# grml-debootstrap --target /srv/debian --password grml --hostname docker [--force] +```` + +*TIP:* to speed up the build prepend `eatmydata` in the the grml-debootstrap command line + +*TIP:* if you want to have access to the generated Debian systems after exiting the container make sure to share your working directory as `/srv` via adding `-v $PWD:/srv/` to your `docker run` command line + +Usage of test scripts +--------------------- + +This directory provides example scripts (`test*.sh`) and tests (`*.bats`) for building and verifying Debian installations, generated via grml-debootstrap. +To use them make sure this docker directory is available inside the docker container at /srv: + +```` +% docker run -it --privileged=true -v $PWD:/srv/ --rm mika/grml-debootstrap +```` + +Then you can simply invoke `/srv/test_dirinstall.sh` or `/srv/test_vminstall.sh`, which will install Debian systems at `/srv/debian` or `/srv/debian.img` respectively and run some tests on the resulting systems.