Code-server: Docker image build failed | "Command failed: yarn gulp compile-extensions-build --max-old-space-size=32384"

Created on 2 Nov 2019  路  11Comments  路  Source: cdr/code-server


  • code-server version: 1.39.2
  • OS Version: MacOS Catalina + Docker Desktop 2.1.0.4

Description

Step 9/21 : RUN yarn    && MINIFY=true GITHUB_TOKEN="${githubToken}" yarn build "${vscodeVersion}" "${codeServerVersion}"   && yarn binary "${vscodeVersion}" "${codeServerVersion}"    && mv "/src/binaries/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64" /src/binaries/code-server    && rm -r /src/build     && rm -r /src/source
 ---> Running in e1d9ba99ef67
yarn install v1.13.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @coder/[email protected]" has unmet peer dependency "@google-cloud/logging@^4.5.2".
[4/4] Building fresh packages...
Done in 36.04s.
yarn run v1.13.0
$ yarn && yarn runner build 1.39.2 docker
[1/4] Resolving packages...
success Already up-to-date.
$ cd ./scripts && node --max-old-space-size=32384 -r ts-node/register ./build.ts build 1.39.2 docker
[build] Not running inside VS Code
[build] rootPath is "/src"
[build] outPath is "/src"
[build] arch is "x86_64"
[build] target is "linux"
[build] vscodeVersion is "1.39.2"
[build] codeServerVersion is "docker"
[build] Installing code-server dependencies...took 492ms
[build] Cloning VS Code...took 3121ms
[build] Installing VS Code dependencies...took 248575ms
[build] Building default extensions...failed
Command failed: yarn gulp compile-extensions-build --max-old-space-size=32384
(node:5348) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
Killed
error Command failed with exit code 137.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c yarn    && MINIFY=true GITHUB_TOKEN="${githubToken}" yarn build "${vscodeVersion}" "${codeServerVersion}"   && yarn binary "${vscodeVersion}" "${codeServerVersion}"    && mv "/src/binaries/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64" /src/binaries/code-server    && rm -r /src/build     && rm -r /src/source' returned a non-zero code: 1

Steps to Reproduce

  1. Clone repository
  2. Run command: docker build --tag trevor/code-server --build-arg vscodeVersion=1.39.2 --build-arg githubToken=xxxxxxxxxxx .
bug

Most helpful comment

Same issue (with or without GitHub token) when building on Windows 10 (cmd) and Docker 2.1.0

All 11 comments

Might be ratelimits, try restarting it again, without githubToken. It usually works.

Same issue here, tried without githubToken

macOS Mojave && Docker 2.1.0.3

```bash
Step 9/28 : RUN yarn && MINIFY=true yarn build "${vscodeVersion}" "${codeServerVersion}" && yarn binary "${vscodeVersion}" "${codeServerVersion}" && mv "/src/binaries/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64" /src/binaries/code-server && rm -r /src/build && rm -r /src/source
---> Running in 100feb092e24
yarn install v1.13.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @coder/[email protected]" has unmet peer dependency "@google-cloud/logging@^4.5.2".
[4/4] Building fresh packages...
Done in 24.12s.
yarn run v1.13.0
$ yarn && yarn runner build 1.39.2 2.1
[1/4] Resolving packages...
success Already up-to-date.
$ cd ./scripts && node --max-old-space-size=32384 -r ts-node/register ./build.ts build 1.39.2 2.1
[build] Not running inside VS Code
[build] rootPath is "/src"
[build] outPath is "/src"
[build] arch is "x86_64"
[build] target is "linux"
[build] vscodeVersion is "1.39.2"
[build] codeServerVersion is "2.1"
[build] Installing code-server dependencies...took 424ms
[build] Cloning VS Code...took 3170ms
[build] Installing VS Code dependencies...took 211649ms
[build] Building default extensions...failed
Command failed: yarn gulp compile-extensions-build --max-old-space-size=32384
(node:5349) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
Killed
error Command failed with exit code 137.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c yarn && MINIFY=true yarn build "${vscodeVersion}" "${codeServerVersion}" && yarn binary "${vscodeVersion}" "${codeServerVersion}" && mv "/src/binaries/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64" /src/binaries/code-server && rm -r /src/build && rm -r /src/source' returned a non-zero code: 1```

I have same issue on my end. Trying to build the docker container ends up with same error. Did you get around this in any way?

hey @simeneriks1 are you attempting to build on MacOS ? @pcgeek86 and my attempts failed on MacOS.

Interestingly I built this yesterday on two different docker-ce versions under Linux. Yet the MacOS builds still failed.. Not sure why yet, or what the different would be as I haven't looked into it too deeply yet.

Yep, MacOS today. Just got it running on Crostini (ChromeOS) so I am fine for now. At least I am subscribed here now.

Same issue for me trying to build the image on MacOS

Ditto, MacOS Catalina && Docker 2.1.0.5 - yarn gulp minify error when building

Just tried building it on ubuntu, and got same error there too.

Same issue (with or without GitHub token) when building on Windows 10 (cmd) and Docker 2.1.0

error Command failed with exit code 137. indicates system ran out of memory, try reducing max-old-space-size from 32GB to a value less than the amount of ram the building system has or try upping the build system ram to over 32GB.

Nice tip @deftdawg. I raised my Docker VM's memory to 12.5 GB, and re-ran the build successfully. I tried with 8 GB of memory, and that wasn't enough -- I got a different set of errors.

Solution: Raise Docker VM memory to 12.5 GB and run build successfully.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

balazssoltesz picture balazssoltesz  路  3Comments

infogulch picture infogulch  路  3Comments

Arsaev picture Arsaev  路  3Comments

grant picture grant  路  3Comments

tecosaur picture tecosaur  路  3Comments