The Citizens Advice Ruby on Rails base image
10K+
This is the Citizens Advice Ruby on Rails base docker image. It uses the official docker ruby image as its base.
Create a Dockerfile in your Rails app project:
FROM rails:onbuild
The Dockerfile should go into the root of your app directory.
The image contains ONBUILD triggers to include the app folder and install gems.
You can build and run the image:
$ docker build --tag rails-docker .
$ docker run --name my-rails-app rails-docker
Run the following command to update the Gemfile.lock in the root of your app directory:
$ docker run --rm -v "$PWD":/app -w /app rails-docker bundle update
To generate a new rails project:
$ docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/app -w /app citizensadvice/rails new --skip-bundle app-name
This will create a sub-directory called app-name in your current directory.
For when you need to update this image to a new Rails or Ruby version or changes to the Dockerfile script
{rails version}-ruby-{ruby version}{-extra} e.g. 5.2.3-ruby-2.6.3 or 5.2.3-ruby-2.5.5-slimmasterContent type
Image
Digest
Size
965.1 MB
Last updated
over 5 years ago
docker pull citizensadvice/rails