|
1 | | -# docker |
2 | | -Kohana Docker Images ( kohana.world, koseven, modseven) |
| 1 | +# Kohana.World Docker Images ( kohana.world, koseven, modseven) |
| 2 | + |
| 3 | + |
| 4 | +This repository holds docker images which can be used for Kohana Framework. |
| 5 | + |
| 6 | +There will be 4 branches which all server a different purpose: |
| 7 | + |
| 8 | +| Branch | Purpose | |
| 9 | +| --------------- |---------------------------------------------------------------------------------------------| |
| 10 | +| master | Image for a development/production environment. | |
| 11 | +| travis | Image for Unit-Testing inside Travis CI (CAREFUL: Don't use on production servers.) | |
| 12 | +| devel | Development Branch for `master`. Only latest `kohana:devel` version will be supproted. | |
| 13 | +| travis-devel | Development Branch for `travis`. Only latest `kohana:devel` version will be supproted. | |
| 14 | + |
| 15 | +## Using the container images |
| 16 | + |
| 17 | +Using one of the container is quite straight forward. |
| 18 | +The docker repository for them is called `kohanaworld/docker`. |
| 19 | + |
| 20 | +By specifying the desired branch as docker-tag you can acquire the desired image. |
| 21 | + |
| 22 | +_Note: for pulling the `master` branch use `latest` as tag name._ |
| 23 | + |
| 24 | +e.g. This will pull the master branch image: |
| 25 | +`docker pull kohanaworld/docker:latest` |
| 26 | + |
| 27 | +e.g This will pull the travis branch image: |
| 28 | +`docker pull kohanaworld/docker:travis-devel` |
| 29 | + |
| 30 | +After executing the `docker pull` command from above you're done setting up |
| 31 | +your docker image, now you can go ahead and use it! |
| 32 | + |
| 33 | +## Example for using `master` image |
| 34 | + |
| 35 | +__Coming Soon. Stay tuned!__ |
| 36 | + |
| 37 | +## Example for using `travis-devel` image |
| 38 | + |
| 39 | +For this particular Image you have multiple options. |
| 40 | + |
| 41 | +1. Some IDE's ([PHPStorm](https://intellij-support.jetbrains.com/hc/en-us/community/posts/14391537025170-PHPUnittests-via-docker-by-PHPStorm-Configuration) for example) have full support for docker unittesting, you just need to configure it there and |
| 42 | + you are good to go! |
| 43 | + |
| 44 | +2. Run the tests from the cli. Execute the following cli commands (from within your Kohana installation folder): |
| 45 | + Start container in background and mount installation folder: |
| 46 | + |
| 47 | + ```shell |
| 48 | + docker stop unittest && docker rm unittest |
| 49 | + docker run -dtP --name unittest -v $(pwd):/tmp/kohana/ kohanaworld/docker:travis-devel |
| 50 | + ``` |
| 51 | + |
| 52 | +3. Start services, install composer requirements and run PHPUnit |
| 53 | + ```shell |
| 54 | + docker exec unittest /bin/sh -c "service redis-server start; service memcached start" |
| 55 | + cd /tmp/kohana |
| 56 | + update-alternatives --config php |
| 57 | + # switch php version |
| 58 | + composer install |
| 59 | + php vendor/bin/phpunit" |
| 60 | + ``` |
| 61 | +
|
| 62 | +_(Hint) You can execute a `/bin/bash` shell inside the container and modify it before Unit-Testing |
| 63 | +```shell |
| 64 | +docker exec -it unittest /bin/bash |
| 65 | +cd /tmp/kohana |
| 66 | +``` |
| 67 | +_(Hint) You can execute a single test |
| 68 | +```shell |
| 69 | +docker exec -it unittest /bin/bash |
| 70 | +cd /tmp/kohana |
| 71 | +composer install |
| 72 | +php vendor/bin/phpunit --filter HTMLTest |
| 73 | +php vendor/bin/phpunit --filter HTMLTest --debug |
| 74 | +``` |
| 75 | +_ |
| 76 | +
|
| 77 | +For more examples / tutorials how to create and interact with container visit the official [Docker Help](https://docs.docker.com/get-started/) |
| 78 | +
|
| 79 | +## Roadmap |
| 80 | +
|
| 81 | +| Target | Release date | |
| 82 | +| ---------------------- |--------------| |
| 83 | +| Initial `master` image | 2024.07.01 | |
| 84 | +| Initial `travis` image | 2024.06.16 | |
| 85 | +| Initial `travis-devel` | 2024.06.09 | |
| 86 | +
|
| 87 | +## Contributing |
| 88 | +
|
| 89 | +As usual, [fork and send pull requests](https://github.com/kohanaxworld/docker/pulls) |
| 90 | +
|
| 91 | +## Getting Help |
| 92 | +
|
| 93 | +* Open issues in this project. |
| 94 | +
|
| 95 | +## TODO |
| 96 | +
|
0 commit comments