How To Use

A docker container will be launched that will update the cobalt.dev source files in the Cobalt repository specified by the environment variable COBALT_SRC or the current working directory, which should be the root of the Cobalt repository, if that environment variable is not set.

When the docsite service is run, the container will then host the updated cobalt.dev site locally on port 4000.

When the docsite-build-only service is run, the container will build and output the site content in the directory out/deploy/www at the root of the Cobalt directory, and copy the app.yaml deployable into out/deploy.

How To Run

docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) SERVICE

docker-compose up SERVICE

Notes

A separate docker-compose.yml was created due to the root docker-compose.yml being unable to locate the Gemfile in the Docker build context.

The Gemfile was copied from third_party/repo-publishing-toolkit/Gemfile because we need to run bundle install with elevated permissions but if we let the preview-site.sh, which normally installs gems, run with elevated permissions the resulting files added or modified would not be accessible to the user who ran the Docker container.

GKE version

For Buildbot on GKE, we use base images then layer the Buildbot worker image atop. This currently requires root to work, so we have a separate simplified Dockerfile which only has the necessary ruby and gems installed, plus the additional libs required for Buildbot. To build and push a new version run:

docker build -t gcr.io/cobalt-buildbot-gcr/docsite-builder -f Dockerfile-gke .

docker push gcr.io/cobalt-buildbot-gcr/docsite-builder