Dockerfile: Move Go step after JS step, since it's faster (#24221)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen 2020-05-04 11:59:10 +02:00 committed by GitHub
parent 6768fb3672
commit 6fb7a60a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 31 deletions

View File

@ -1,20 +1,3 @@
# Golang build container
FROM golang:1.14.2-alpine3.11 as go-builder
RUN apk add --no-cache gcc g++
WORKDIR $GOPATH/src/github.com/grafana/grafana
COPY go.mod go.sum ./
RUN go mod verify
COPY pkg pkg
COPY build.go package.json ./
RUN go run build.go build
# Node build container
FROM node:12.16.3-alpine3.11 as js-builder
WORKDIR /usr/src/app/
@ -33,7 +16,22 @@ COPY emails emails
ENV NODE_ENV production
RUN ./node_modules/.bin/grunt build
# Final container
FROM golang:1.14.2-alpine3.11 as go-builder
RUN apk add --no-cache gcc g++
WORKDIR $GOPATH/src/github.com/grafana/grafana
COPY go.mod go.sum ./
RUN go mod verify
COPY pkg pkg
COPY build.go package.json ./
RUN go run build.go build
# Final stage
FROM alpine:3.11
LABEL maintainer="Grafana team <hello@grafana.com>"

View File

@ -1,16 +1,3 @@
FROM golang:1.14.2 AS go-builder
WORKDIR /src/grafana
COPY go.mod go.sum ./
RUN go mod verify
COPY build.go package.json ./
COPY pkg pkg/
RUN go run build.go build
FROM node:12.16.3-slim AS js-builder
WORKDIR /usr/src/app/
@ -29,6 +16,19 @@ COPY emails emails
ENV NODE_ENV production
RUN ./node_modules/.bin/grunt build
FROM golang:1.14.2 AS go-builder
WORKDIR /src/grafana
COPY go.mod go.sum ./
RUN go mod verify
COPY build.go package.json ./
COPY pkg pkg/
RUN go run build.go build
FROM ubuntu:20.04
LABEL maintainer="Grafana team <hello@grafana.com>"