3
0
mirror of https://github.com/grafana/grafana.git synced 2025-02-25 18:55:37 -06:00

Chore: Update Dockerfile to make it work ()

This commit is contained in:
Chunlin Yang 2021-10-26 18:08:31 +08:00 committed by GitHub
parent 2343055dff
commit 54899f91ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 10 deletions

View File

@ -15,4 +15,11 @@ node_modules
/local
/tmp
*.yml
!.yarnrc.yml
*.md
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/versions
!.yarn/cache

View File

@ -3,10 +3,12 @@ FROM node:16-alpine3.14 as js-builder
WORKDIR /usr/src/app/
COPY package.json yarn.lock ./
COPY .yarnrc.yml ./
COPY .yarn .yarn
COPY packages packages
COPY plugins-bundled plugins-bundled
RUN apk --no-cache add git
RUN yarn install --pure-lockfile --no-progress
RUN yarn install
COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js ./
COPY public public
@ -19,7 +21,7 @@ RUN yarn build
FROM golang:1.17.0-alpine3.14 as go-builder
RUN apk add --no-cache gcc g++
RUN apk add --no-cache gcc g++ make
WORKDIR $GOPATH/src/github.com/grafana/grafana
@ -29,10 +31,11 @@ COPY cue.mod cue.mod
COPY packages/grafana-schema packages/grafana-schema
COPY public/app/plugins public/app/plugins
COPY pkg pkg
COPY build.go package.json ./
COPY .bingo .bingo
COPY Makefile build.go package.json ./
RUN go mod verify
RUN go run build.go build
RUN make build-go
# Final stage
FROM alpine:3.14.2

View File

@ -1,12 +1,14 @@
FROM node:14.15.1-slim AS js-builder
FROM node:16-alpine3.14 as js-builder
WORKDIR /usr/src/app/
COPY package.json yarn.lock ./
COPY packages packages
COPY .yarnrc.yml ./
COPY .yarn .yarn
COPY plugins-bundled plugins-bundled
RUN apt-get update && apt-get install -yq git
RUN yarn install --pure-lockfile
RUN yarn install
COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js ./
COPY public public
@ -22,7 +24,8 @@ FROM golang:1.17.0 AS go-builder
WORKDIR /src/grafana
COPY go.mod go.sum embed.go ./
COPY build.go package.json ./
COPY Makefile build.go package.json ./
COPY .bingo .bingo
COPY pkg pkg/
COPY cue cue/
COPY cue.mod cue.mod/
@ -30,7 +33,7 @@ COPY packages/grafana-schema packages/grafana-schema/
COPY public/app/plugins public/app/plugins/
RUN go mod verify
RUN go run build.go build
RUN make build-go
FROM ubuntu:20.04