prezto/container-README.md

57 lines
1.9 KiB
Markdown
Raw Normal View History

2019-10-26 03:00:47 +08:00
# prezto docker container
This branch contains a Dockerfile and a Makefile that hopefully may
prove helpful for prezto development.
The idea is to have a totally independendn and isolated environemnet
in which to quickly make changes to either prezto-core or any plugin
that may bein development, enabling automated testing and even
continuous integration.
[![asciicast](https://asciinema.org/a/277054.svg)](https://asciinema.org/a/277054)
2019-10-26 03:00:47 +08:00
The container is a basic install of alpine linux, so the image
download is reasonably small
On the container we have a few utilities and additionalsoftware that
2019-10-26 04:41:01 +08:00
prezto has core support for, and you can check it out in a snap by doing:
2019-10-26 03:00:47 +08:00
2019-10-26 04:41:01 +08:00
```bash
docker pull hlecuanda/prezto-dev:latest
```
2019-10-26 03:00:47 +08:00
once you have the image, create a container from it with:
2019-10-26 04:41:01 +08:00
```bash
2019-10-26 03:00:47 +08:00
docker run -it --rm -h prezto hlecuanda/prezto-dev:latest
2019-10-26 04:41:01 +08:00
```
2019-10-26 03:00:47 +08:00
2019-10-26 04:41:01 +08:00
That will set you on a prompt within the container with a
2019-10-26 03:00:47 +08:00
vanilla install of prezto.
2019-10-26 04:41:01 +08:00
A development and testing workflow can be achieved by mounting the stuff
2019-10-26 03:00:47 +08:00
you're working on to the image's filesystem:
2019-10-26 04:41:01 +08:00
```bash
2019-10-26 03:00:47 +08:00
docker run -it --rm -h prezto \
-v /local/path:/home/prezto \
-v /local/path/zdotdir:/home/preztoa \
-v /local/module-dev-src:/home/prezto/.zprezto/modules/yourmodulea \
hlecuanda/prezto-dev:latest
2019-10-26 04:41:01 +08:00
```
2019-10-26 03:00:47 +08:00
the third volume mapping is particularly interesting. you can
2019-10-26 04:41:01 +08:00
develop on your own machine and environnment, and when spinning up the
container, your actual source is already in-plase as if installed on a
vanilla prezto instance
2019-10-26 03:00:47 +08:00
keep in mind that the container are ephemeral, unless you remove the
2019-10-26 04:41:01 +08:00
`--rm` option which will create new containers each time you run the
2019-10-26 03:00:47 +08:00
command, but the changes to the filesystemwill persist on a container
2019-10-26 04:41:01 +08:00
file that you can later spin up again to re-use.
2019-10-26 03:00:47 +08:00
I have found epehermeral containers to be most useful since you get an
untainted, pristine environment for testing every time you spin up the
container.
2019-10-26 04:41:01 +08:00
hope this turns out to be useful.