[20180910151539] Development Builds

This release allows you to use multi-stage Docker builds to create separate development and production images for your applications.

# development
FROM ubuntu:16.04 AS development
RUN apt-get update && apt-get install -yy build-essential git
WORKDIR /go/src/github.com/convox/myapp
COPY . .
RUN go install .
CMD ["bin/development"]

# production
FROM debian:stretch
COPY --from=development /go/bin/myapp /go/bin/myapp
CMD ["/go/bin/myapp"]

Using the second stage allows you to copy only the specific files and directories needed by your application to run during production. This allows you to builld production containers that do not contain support tools such as compilers and debuggers while still using those tools to actively work on your application.

When using convox start, if a stage named development exists then only that stage will be built and used to run the application.

When deploying to a rack, the entire Dockerfile will be built.

See Rack’s own Dockerfile for a more complete example.