This code is used to build and publish a Docker image that the Single Cell Portal team uses as a basis for Rails servers.
Jobs for this repo are at: https://github.com/broadinstitute/scp-rails-baseimage/actions
This provides a base image with Ruby on Rails ready to go with Phusion Passenger. The Single Cell Portal has a Docker image that was formerly built on phusion/passenger-docker
, but this ensures that it's built on a managed base image provided by Google, which is good because they keep those images up-to-date with security fixes and it apparently makes our auditors happy. So here, we rebuild a couple images from Phusion with tweaks to make that happen.
This image is available as singlecellportal/rails-baseimage
on Dockerhub, so specify that in your Docker commands or Dockerfile.
./Dockerfile
is the main Docker file as you would expect, so that's the file to modify to change what's in the image.
To update the versions of the underlying images, modify requirements.bash (and the Dockerfile). We are specifying a Docker image version for the underlying base image, but the version numbers for the Phusion images actually correspond to GitHub release tags, since we are rebuilding them from (slightly altered) source.
To make changes to how the various layers get downloaded, changed and rebuilt, look in ./lib/
and ./ci/
.
run git grep DEBUG_HACK
to find a couple places in the code that might be worth editing to develop faster.
Once you have made changes that you are ready to test, you'll want to:
- build the image. Running
./ci/local_build
is recommended way to do this on a workstation. All of the high-level scripts that would normally be called directly are in./ci/
, includingbuild
andlocal_build
. If you have the right prerequisites installed, you could runbuild
directly on a workstation, butlocal_build
will take care of running it in a container that has the necessary things installed already. If the image builds successfully, you can use it to do further testing. - run ./ci/test and make sure it exits with 0
To publish your changes, you'll need to increment the version number in ./version.txt
(in accordance with SemVer, please), and get your changes committed, pushed, and merged into the main
branch. At that point, this Github workflow will attempt to build and publish your changes to GCR. It is not recommended (or likely possible) to publish locally.