Improve image building (primarily for discourse_dev)
[discourse_docker.git] / image / README.md
CommitLineData
3447089f
JR
1# Docker images
2
3## Building new images
4
5To build a new set of images, update the `Makefile` with the new version number, and then `make all`. This will automatically update the header comments in the Dockerfiles and update any `FROM` statements to ensure that the image verions remain in lock-step with each other. (The downside is that if you only wanted to tweak a "leaf" image, you'll still be touching/updating _all_ of the images. But reasoning about the images is much easier if they all have the same version.)
6
7> _A note about building on OSX:_ While the `Makefile` has provisions for acquiring an OS-specific version of docker-squash, running the Darwin (OSX) version doesn't work on my machine. To cope, OSX builds simply skip the docker-squash step. Since I'm not going to be pushing images up to Docker Hub, that's okay with me.
8
9The build process will tag the images with the version number, but not with "latest", nor will it push the images up to Docker Hub. Both of those steps must be performed manually.
10
11## More about the images
12
13See both `Makefile` and the respective `Dockerfile`s for details on _how_ all of this happens.
14
15
16### base ([discourse/base](https://hub.docker.com/r/discourse/base/))
17
18All of the dependencies for running Discourse. This includes runit, postgres, nginx, ruby, imagemagick, etc. It also includes the creation of the "discourse" user and `/var/www` directory.
19
20
21### discourse ([discourse/discourse](https://hub.docker.com/r/discourse/discourse/))
22
23Builds on the base image and adds the current (as of image build time) version of Discourse, cloned from GitHub, and also the bundled gems.
24
25
26### discourse_dev ([discourse/discourse_dev](https://hub.docker.com/r/discourse/discourse_dev/))
27
28Adds redis and postgres just like the "standalone" template for Discourse in order to have an all-in-one container for development. Note that you are expected to mount your local discourse source directory to `/src`. See [the README in GitHub's discourse/bin/docker](https://github.com/discourse/discourse/tree/master/bin/docker/) for utilities that help with this.
29
30Note that the discourse user is granted "sudo" permission without asking for a password in the discourse_dev image. This is to facilitate the command-line Docker tools in discourse proper that run commands as the discourse user.
31
32
33### discourse_test ([discourse/discourse_test](https://hub.docker.com/r/discourse/discourse_test/))
34
35Builds on the discourse image and adds testing tools and a default testing entrypoint.
36
37
38### discourse_bench ([discourse/discourse_bench](https://hub.docker.com/r/discourse/discourse_bench/))
39
40Builds on the discourse_test image and adds benchmark testing.
41
42
43### discourse_fast_switch ([discourse/discourse_fast_switch](https://hub.docker.com/r/discourse/discourse_fast_switch/))
44
45Builds on the discourse image and adds the ability to easily switch versions of Ruby.