Skip to content

use multi-stage dockerfiles

Warren Gifford requested to merge multi-stage-build into master

Created by: ggilmore

Implements RFC 37: Use multi-stage Docker builds for Sourcegraph images

Overview

Before

  1. Generate assets in buildkite-agent's external environment, place them some OUTPUT folder
  2. Run docker build ... $OUTPUT, which passes the folder containing the assets as the Docker build context
  3. Downloads any extra dependencies and copies over the assets into the final image

After

  1. Run docker build ... $(pwd), which passes a plain checkout of https://github.com/sourcegraph/sourcegraph as the build context

build.sh scripts

All the cmd/**/build.sh scripts have refactored to only do the raw steps of building the binary. The actual "docker build" call has been moved to cmd/**/docker.sh scripts. This provides a cleaner separation of concerns, and makes it easier to re-use the build.sh scripts in different contexts.

Merge request reports

Loading