Improve image building (primarily for discourse_dev)
authorJared Reisinger <jaredreisinger@hotmail.com>
Tue, 20 Sep 2016 22:02:31 +0000 (15:02 -0700)
committerJared Reisinger <jaredreisinger@hotmail.com>
Tue, 20 Sep 2016 22:02:31 +0000 (15:02 -0700)
commit3447089f9ede4e26cb5832ed6c4966259420c06d
tree2df422c2d1c84e70f6b3a897ad68c542ac877213
parent0a27babd4b1a8d7fe220bd6c4792fcdda68c6e79
Improve image building (primarily for discourse_dev)

Move "discourse" user and "/var/www" directory creation into base image
so that discourse_dev can build from base image directly instead of
requiring the overhead of the full discourse image.

Remove discourse_fast_switch dependency from discourse_dev, and remove
the ruby 2.2/2.0 logic, as Discourse already appears to require 2.3.0 or
greater.

Remove discourse_dev's independent `postgres.template.yml` and
`redis.template.yml` files, and instead derive them from the top-level
templates directory.  This ensures that the discourse_dev image is
always up-to-date with the discourse main image.

Add password-less "sudo" permissions for the "discourse" user in the
discourse_dev image.  This simplifies (fixes) the "bundle install"
command (and others) as implemented by discourse/bin/docker utilities.

Add image/Makefile so that images can be built even on machines without
Ruby installed.  Logic is replicated from `image/build.rb`, and should
result in equivalent images.  (Perhaps build.rb should be removed?)

Add automation in Makefile to ensure that all Dockerfiles are updated to
match the version number in the Makefile.  (This includes the `/VERSION`
file written into the base image.)

Add image/README.md to describe the images and process.

Update ImageMagick to 6.9.5-9 in the base Dockerfile because 6.9.5-8 is
no longer available. (Perhaps this dependency should be vendored.)

Fix base "boot" failure caused by missing log files on a new instance
(in `base/runit-1.d-00-fix-var-logs`).  Before chowning the log files,
"touch" them to ensure they exist.  This failure previously prevented
the discourse_dev `ensure-database` script from running, which made
development use of discourse_dev very difficult.

Update to version 1.3.7.  (Driven by IMAGE_VERSION in the Makefile.
Mostly, this is to ensure that the next official build of the images
will be *at least* 1.3.7, superseding any previous versions.)
16 files changed:
.gitignore
README.md
image/Makefile [new file with mode: 0644]
image/README.md [new file with mode: 0644]
image/base/Dockerfile
image/base/install-imagemagick
image/base/runit-1.d-00-fix-var-logs
image/discourse/Dockerfile
image/discourse_bench/Dockerfile
image/discourse_dev/Dockerfile
image/discourse_dev/ensure-database
image/discourse_dev/postgres.template.yml [deleted file]
image/discourse_dev/redis.template.yml [deleted file]
image/discourse_dev/sudoers.discourse [new file with mode: 0644]
image/discourse_fast_switch/Dockerfile
image/discourse_test/Dockerfile