Skip to content

What is the correct way to deploy the code-server on alpine? #6535

Closed as not planned
@dxkrs

Description

@dxkrs

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

alpine3.18.4 in docker container

Steps to Reproduce

I try to step by step with the offical docs.

  1. docker run --ti alpine:3.18.4
  2. apk update && apk add alpine-sdk bash libstdc++ libc6-compat
  3. apk add python3
  4. apk add nodejs=18.18.2-r0
  5. apk add npm
  6. npm config set python python3 , this command will error, then I try it the npm config edit and add the 'python=python3` in the open file
  7. export FORCE_NODE_VERSION=18
  8. npm install --global code-server --unsafe-perm

Expected

success deploy the code-server

Actual

Print a log of error at the last step.
I see the err tips:"You may not have the required dependencies to build the native modules", then I try to see the lists Node.js requirements and confirm the prerequisites, but also not success.

Logs

/ # npm install --global code-server --unsafe-perm
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/code-server
npm ERR! command failed
npm ERR! command sh -c sh ./postinstall.sh
npm ERR! WARNING: Overriding required Node.js version to v18
npm ERR! This could lead to broken functionality, and is unsupported.
npm ERR! USE AT YOUR OWN RISK!
npm ERR! Installing Code dependencies...
npm ERR! User agent: npm/9.6.6 node/v18.18.2 linux x64 workspaces/false
npm ERR! You may not have the required dependencies to build the native modules.
npm ERR! Please see https://github.com/coder/code-server/blob/main/docs/npm.md
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/kerberos
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c prebuild-install --runtime napi || node-gyp rebuild
npm ERR! npm ERR! make: Entering directory '/usr/local/lib/node_modules/code-server/lib/vscode/node_modules/kerberos/build'
npm ERR! npm ERR!   CXX(target) Release/obj.target/kerberos/src/kerberos.o
npm ERR! npm ERR! make: Leaving directory '/usr/local/lib/node_modules/code-server/lib/vscode/node_modules/kerberos/build'
npm ERR! npm ERR! prebuild-install warn install No prebuilt binaries found (target=4 runtime=napi arch=x64 libc=musl platform=linux)
npm ERR! npm ERR! gyp info it worked if it ends with ok
npm ERR! npm ERR! gyp info using [email protected]
npm ERR! npm ERR! gyp info using [email protected] | linux | x64
npm ERR! npm ERR! gyp info find Python using Python version 3.11.6 found at "/usr/bin/python3"
npm ERR! npm ERR! gyp info spawn /usr/bin/python3
npm ERR! npm ERR! gyp info spawn args [
npm ERR! npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! npm ERR! gyp info spawn args   '-f',
npm ERR! npm ERR! gyp info spawn args   'make',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/code-server/lib/vscode/node_modules/kerberos/build/config.gypi',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/root/.cache/node-gyp/18.18.2/include/node/common.gypi',
npm ERR! npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/18.18.2',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/18.18.2/<(target_arch)/node.lib',
npm ERR! npm ERR! gyp info spawn args   '-Dmodule_root_dir=/usr/local/lib/node_modules/code-server/lib/vscode/node_modules/kerberos',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! npm ERR! gyp info spawn args   '--depth=.',
npm ERR! npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! npm ERR! gyp info spawn args   '--generator-output',
npm ERR! npm ERR! gyp info spawn args   'build',
npm ERR! npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! npm ERR! gyp info spawn args ]
npm ERR! npm ERR! gyp info spawn make
npm ERR! npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! npm ERR! In file included from ../src/kerberos_common.h:5,
npm ERR! npm ERR!                  from ../src/kerberos.h:12,
npm ERR! npm ERR!                  from ../src/kerberos.cc:1:
npm ERR! npm ERR! ../src/unix/kerberos_gss.h:21:14: fatal error: gssapi/gssapi.h: No such file or directory
npm ERR! npm ERR!    21 |     #include <gssapi/gssapi.h>
npm ERR! npm ERR!       |              ^~~~~~~~~~~~~~~~~
npm ERR! npm ERR! compilation terminated.
npm ERR! npm ERR! make: *** [kerberos.target.mk:110: Release/obj.target/kerberos/src/kerberos.o] Error 1
npm ERR! npm ERR! gyp ERR! build error
npm ERR! npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm ERR! npm ERR! gyp ERR! System Linux 3.10.0-1160.83.1.el7.x86_64
npm ERR! npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/kerberos
npm ERR! npm ERR! gyp ERR! node -v v18.18.2
npm ERR! npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! npm ERR! gyp ERR! not ok
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-11-15T11_07_26_826Z-debug-0.log

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-11-15T11_07_16_538Z-debug-0.log

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over a secure context?

  • I am using a secure context.

Notes

So, what the correct way to deploy the code-server on alpine? Or is it not support the alpine in docker?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageThis issue needs to be triaged by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions