With one package in line and in alphabetic order, it's easier to see
which packages we're installing.
We're also applying the same formatting (taking from the Docker
documentation [1]) to other lines running multiple instructions.
[1] https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
Quoting the Docker documentation [1]:
> Always combine RUN apt-get update with apt-get install in the same RUN
> statement.
> (...)
> Using apt-get update alone in a RUN statement causes caching issues
> and subsequent apt-get install instructions fail.
> (...)
> Docker sees the initial and modified instructions as identical and
> reuses the cache from previous steps. As a result the apt-get update
> is not executed because the build uses the cached version. Because the
> apt-get update is not run, your build can potentially get an outdated
> version of the curl and nginx packages.
>
> Using RUN apt-get update && apt-get install -y ensures your Dockerfile
> installs the latest package versions with no further coding or manual
> intervention.
[1] https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
The --full-index option seemed to be causing caching issues on some
systems.
Since we don't know the reason why this option was added in the first
place, it might have some advantages. However, some people have reported
problems getting "version can no longer be found" errors for some gems
in this step, and documentation for Docker and Rails doesn't mention
this option at all.
I think we could have already done so when upgrading Ruby to version
2.6.x (which also included the Bundler gem), but since we didn't, now
that we've upgraded to Bundler 2.x it's probably a good moment.
Debian Bullseye was released two days ago, and is now the default
distribution for the Docker image.
Our image isn't compatible with Debian Bullseye right now, and we
haven't done any testing with it, so for now we're staying with Buster.
Our Docker image uses Chromium v57, which is not supported by
chromedriver versions after 2.38. See
https://bugs.chromium.org/p/chromedriver/issues/detail?id=2445
The reason that the version of chromium is so old is that our base
image ruby:2.3.6 (the standard image for Ruby 2.3.6 on DockerHub) is
built on Debian 8 (jessie), which was made obsolete over a year ago.
The best solution is probably to upgrade the application to Ruby 2.3.7
(if not later), so we can use the official ruby:2.3.7 image, which is
kept up-to-date (it has Chromium 68).
Alternatively, we could try to install Chromium from a more up-to-date
repository, but this is probably not worth the trouble.
The following enhancements have been made to docker/docker-compose
* Fixed bug when building the image.
* docker-compose up starts the server
* Scaffolding inside the container respect the ownership of the files
outside it
* Volumes are tagged as 'delegated' in order to improve performance for
mac/windoze users.
* bundler stores packages in a volume. This whay new packages can be
added without rebuilding the image:
```bash
docker-compose run app bundle install
```