Grafana docker build failed - Couldn't find any versions for "@grafana/data" that matches "workspace:*"

Hi Team,

I have downloaded Grafana from GitHub and trying to do docker build but it is failing with below error stack. Please let me know if I am missing something here.

=> CANCELED [go-builder 12/12] RUN go run build.go build                                                                                                      35.8s 
 => ERROR [js-builder  6/12] RUN yarn install --pure-lockfile --no-progress                                                                                    35.1s 
------
 > [js-builder  6/12] RUN yarn install --pure-lockfile --no-progress:
#32 0.626 yarn install v1.22.15
#32 0.808 [1/5] Validating package.json...
#32 0.823 [2/5] Resolving packages...
#32 34.40 error Couldn't find any versions for "@grafana/data" that matches "workspace:*"
#32 34.40 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
executor failed running [/bin/sh -c yarn install --pure-lockfile --no-progress]: exit code: 1

Thanks in advance.

@sharathramprasad if you are still encountering this, please post more details about version info and OS. Thanks :+1:

Even I am getting same issue error Couldn't find any versions for "@grafana/data" that matches "workspace:*"

trying docker Build for custom image from Mac M1(Mac OS monterey)

@mattabrams, @jayarajesvar I am using Windows 10 and Grafana 8.2.2 and this issue got resolved by replacing the docker file in the installation directory with the below docker file.

Thanks.

1 Like

I am getting yarn build error

docker build --build-arg "GRAFANA_VERSION=latest" --platform linux/amd64  -t custom -f Dockerfile . 
[+] Building 1003.6s (41/45)                                                                                                                                                                                
 => [internal] load build definition from Dockerfile                                                                                                                                                   0.0s
 => => transferring dockerfile: 120B                                                                                                                                                                   0.0s
 => [internal] load .dockerignore                                                                                                                                                                      0.0s
 => => transferring context: 118B                                                                                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/alpine:3.14.3                                                                                                                                       1.1s
 => [internal] load metadata for docker.io/library/node:16-alpine3.14                                                                                                                                  1.1s
 => [internal] load metadata for docker.io/library/golang:1.17.3-alpine3.14                                                                                                                            1.1s
 => [internal] load build context                                                                                                                                                                      0.6s
 => => transferring context: 1.63MB                                                                                                                                                                    0.6s
 => [go-builder  1/13] FROM docker.io/library/golang:1.17.3-alpine3.14@sha256:55da409cc0fe11df63a7d6962fbefd1321fedc305d9969da636876893e289e2d                                                         0.0s
 => [js-builder  1/13] FROM docker.io/library/node:16-alpine3.14@sha256:60ef0bed1dc2ec835cfe3c4226d074fdfaba571fd619c280474cc04e93f0ec5b                                                               0.0s
 => [stage-2  1/13] FROM docker.io/library/alpine:3.14.3@sha256:635f0aa53d99017b38d1a0aa5b2082f7812b03e3cdb299103fe77b5c8a07f1d2                                                                       0.0s
 => CACHED [stage-2  2/13] WORKDIR /usr/share/grafana                                                                                                                                                  0.0s
 => CACHED [stage-2  3/13] RUN apk add --no-cache ca-certificates bash tzdata musl-utils                                                                                                               0.0s
 => CACHED [stage-2  4/13] RUN apk add --no-cache openssl ncurses-libs ncurses-terminfo-base --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main                                               0.0s
 => CACHED [stage-2  5/13] RUN apk upgrade ncurses-libs ncurses-terminfo-base --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main                                                              0.0s
 => CACHED [stage-2  6/13] RUN apk info -vv | sort                                                                                                                                                     0.0s
 => CACHED [stage-2  7/13] COPY conf ./conf                                                                                                                                                            0.0s
 => CACHED [stage-2  8/13] RUN if [ ! $(getent group "0") ]; then   addgroup -S -g 0 grafana;   fi                                                                                                     0.0s
 => CACHED [stage-2  9/13] RUN export GF_GID_NAME=$(getent group 0 | cut -d':' -f1) &&   mkdir -p "/usr/share/grafana/.aws" &&   adduser -S -u 472 -G "$GF_GID_NAME" grafana &&   mkdir -p "/etc/graf  0.0s
 => CACHED [js-builder  2/13] WORKDIR /grafana                                                                                                                                                         0.0s
 => CACHED [js-builder  3/13] COPY package.json yarn.lock .yarnrc.yml ./                                                                                                                               0.0s
 => CACHED [js-builder  4/13] COPY .yarn .yarn                                                                                                                                                         0.0s
 => CACHED [js-builder  5/13] COPY packages packages                                                                                                                                                   0.0s
 => CACHED [js-builder  6/13] COPY plugins-bundled plugins-bundled                                                                                                                                     0.0s
 => CACHED [js-builder  7/13] RUN yarn install                                                                                                                                                         0.0s
 => CACHED [js-builder  8/13] COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js babel.config.json ./                                                                           0.0s
 => CACHED [go-builder  2/13] RUN apk add --no-cache gcc g++ make                                                                                                                                      0.0s
 => CACHED [go-builder  3/13] WORKDIR /grafana                                                                                                                                                         0.0s
 => CACHED [go-builder  4/13] COPY go.mod go.sum embed.go Makefile build.go package.json ./                                                                                                            0.0s
 => CACHED [go-builder  5/13] COPY cue cue                                                                                                                                                             0.0s
 => CACHED [go-builder  6/13] COPY packages/grafana-schema packages/grafana-schema                                                                                                                     0.0s
 => CACHED [go-builder  7/13] COPY public/app/plugins public/app/plugins                                                                                                                               0.0s
 => CACHED [go-builder  8/13] COPY pkg pkg                                                                                                                                                             0.0s
 => CACHED [go-builder  9/13] COPY scripts scripts                                                                                                                                                     0.0s
 => CACHED [go-builder 10/13] COPY cue.mod cue.mod                                                                                                                                                     0.0s
 => CACHED [go-builder 11/13] COPY .bingo .bingo                                                                                                                                                       0.0s
 => CACHED [go-builder 12/13] RUN go mod verify                                                                                                                                                        0.0s
 => [js-builder  9/13] COPY public public                                                                                                                                                              1.4s
 => CANCELED [go-builder 13/13] RUN make build-go                                                                                                                                                   1001.8s
 => [js-builder 10/13] COPY tools tools                                                                                                                                                                0.1s
 => [js-builder 11/13] COPY scripts scripts                                                                                                                                                            0.1s
 => [js-builder 12/13] COPY emails emails                                                                                                                                                              0.0s
 => ERROR [js-builder 13/13] RUN yarn build                                                                                                                                                          997.5s
------                                                                                                                                                                                                      
 > [js-builder 13/13] RUN yarn build:                                                                                                                                                                       
------                                                                                                                                                                                                      
executor failed running [/bin/sh -c yarn build]: exit code: 129

Solution for the Issue executor failed running [/bin/sh -c yarn build]: exit code: 129

Might be due to Yarn parallelism. I solved by Increasing Docker CPU: 4, Mem: 4GB, Swap: 4GB.

and added

RUN export NODE_OPTIONS="--max-old-space-size=8192"

to the Docker file.