@@ -54,6 +54,69 @@ We use [GitHub Actions](.github/workflows/lint.yml) to run `pre-commit` on every
5454- [ pre-commit autoupdate] ( https://pre-commit.com/#pre-commit-autoupdate )
5555- [ Temporarily disabling hooks] ( https://pre-commit.com/#temporarily-disabling-hooks )
5656
57+ ## Docker
58+
59+ We have both a ` Dockerfile ` and ` docker-compose.yml ` files in the repository root.
60+ You can run these with the command line or use
61+ [ Docker Desktop] ( https://www.docker.com/products/docker-desktop/ ) .
62+
63+ The Docker image is running Debian bullseye with Ruby and Python installed.
64+ You can build the Docker image with:
65+
66+ ` $ docker-compose build test `
67+
68+ So far we just have one service: ` test ` . Running the default ` docker-compose `
69+ command will create the Docker image, spin up a container and then build and
70+ run all mruby tests.
71+
72+ The default ` docker-compose ` command is:
73+
74+ ` $ docker-compose -p mruby run test `
75+
76+ You can also use Make or Rake to run the default ` docker-compose `
77+ command from above:
78+
79+ - ` make composetest `
80+ - ` rake composetest `
81+
82+ List your Docker images with:
83+
84+ ``` console
85+ $ docker images
86+ REPOSITORY TAG IMAGE ID CREATED SIZE
87+ mruby-test latest ec60f9536948 29 seconds ago 1.29GB
88+ ```
89+
90+ You can also run any custom ` docker-compose ` command which will override
91+ the default. For example to run ` pre-commit run --all-files ` type:
92+
93+ ` $ docker-compose -p mruby run test pre-commit run --all-files `
94+
95+ For convenience, you can also run ` pre-commit ` with:
96+
97+ - ` make composecheck `
98+ - ` rake composecheck `
99+
100+ The bonus of running ` pre-commit ` with ` docker-compose ` is that you won't need
101+ to install ` pre-commit ` and the hooks on your local machine. And that also
102+ means you won't need to install ` brew ` , ` conda ` or ` pip ` .
103+
104+ Note limitation: currently running ` pre-commit ` with ` docker-compose ` we
105+ skip the ` check-executables-have-shebangs ` hook.
106+
107+ Two more examples of custom ` docker-compose ` commands are:
108+
109+ - ` $ docker-compose -p mruby run test ls `
110+ - ` $ docker-compose -p mruby run test rake doc:api `
111+
112+ If you want to test using a different ` docker-compose ` YAML config file you
113+ can use the ` -f ` flag:
114+
115+ ` $ docker-compose -p mruby -f docker-compose.test.yml run test `
116+
117+ - < https://docs.docker.com/compose/ >
118+ - < https://docs.docker.com/engine/reference/commandline/cli/ >
119+
57120## Spell Checking
58121
59122We are using ` pre-commit ` to run [ codespell] ( https://github.com/codespell-project/codespell )
0 commit comments