gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.53k stars 818 forks source link

Docker installation hangs running on Windows #4713

Closed nighto closed 1 year ago

nighto commented 1 year ago

Following the DOCKER.md readme, on the step docker-compose up kosmtik it seems that one package downloaded from apt expects an answer via keyboard, which doesn't seem to be possible at least running it on Windows with PowerShell.

image

The gray output seems to be the CLI output, I can see that apt updates, but eventually when it start to install the packages, it seems to hang on this output. I've tried entering a number but it doesn't seem to accept.

I also tried running it from inside WSL, but after installing docker-compose, it fails to run the import script:

image

ImreSamu commented 1 year ago

@nighto :

Try to add DEBIAN_FRONTEND=noninteractive as suggested in https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image

nighto commented 1 year ago

Thanks for the tip @ImreSamu. It managed to install tz-data correctly, but it seems to fail on a later step:

PS D:\Users\APereira\src\openstreetmap-carto> docker-compose up kosmtik
Building kosmtik
[+] Building 153.8s (6/10)
 => [internal] load build definition from Dockerfile                                                                                     0.0s
 => => transferring dockerfile: 1.40kB                                                                                                   0.0s 
 => [internal] load .dockerignore                                                                                                        0.0s 
 => => transferring context: 34B                                                                                                         0.0s 
 => [internal] load metadata for docker.io/library/ubuntu:focal                                                                          0.7s 
 => CACHED [1/7] FROM docker.io/library/ubuntu:focal@sha256:9c2004872a3a9fcec8cc757ad65c042de1dad4da27de4c70739a6e36402213e3             0.0s
 => [2/7] RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y     ca-certifica  124.8s 
 => ERROR [3/7] RUN npm set prefix /usr && npm install -g "git+https://git@github.com/kosmtik/kosmtik.git#f176c4c"                      28.3s
------
 > [3/7] RUN npm set prefix /usr && npm install -g "git+https://git@github.com/kosmtik/kosmtik.git#f176c4c":
#6 5.261 npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
#6 5.487 npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
#6 19.40 npm WARN deprecated har-validator@5.1.5: this library is no longer supported
#6 19.55 npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
#6 26.06 /usr/bin/kosmtik -> /usr/lib/node_modules/kosmtik/index.js
#6 26.12
#6 26.12 > mapnik@4.5.9 install /usr/lib/node_modules/kosmtik/node_modules/mapnik
#6 26.12 > node-pre-gyp install --fallback-to-build
#6 26.12
#6 26.85 node-pre-gyp WARN Pre-built binaries not installable for mapnik@4.5.9 and node@10.19.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
#6 26.85 node-pre-gyp WARN Hit error ENOENT: no such file or directory, mkdir
#6 27.62 gyp ERR! configure error
#6 27.62 gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/kosmtik/node_modules/mapnik/build'
#6 27.62 gyp ERR! System Linux 5.10.16.3-microsoft-standard-WSL2
#6 27.62 gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "configure" "--fallback-to-build" "--module=/usr/lib/node_modules/kosmtik/node_modules/mapnik/lib/binding/mapnik.node" "--module_name=mapnik" "--module_path=/usr/lib/node_modules/kosmtik/node_modules/mapnik/lib/binding" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
#6 27.62 gyp ERR! cwd /usr/lib/node_modules/kosmtik/node_modules/mapnik
#6 27.63 gyp ERR! node -v v10.19.0
#6 27.63 gyp ERR! node-gyp -v v6.1.0
#6 27.63 gyp ERR! not ok
#6 27.63 node-pre-gyp ERR! build error
#6 27.63 node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/bin/node-gyp configure --fallback-to-build --module=/usr/lib/node_modules/kosmtik/node_modules/mapnik/lib/binding/mapnik.node --module_name=mapnik --module_path=/usr/lib/node_modules/kosmtik/node_modules/mapnik/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
#6 27.63 node-pre-gyp ERR! stack     at ChildProcess.cmd.on (/usr/lib/node_modules/kosmtik/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
#6 27.63 node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
#6 27.63 node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
#6 27.63 node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
#6 27.63 node-pre-gyp ERR! System Linux 5.10.16.3-microsoft-standard-WSL2
#6 27.63 node-pre-gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/kosmtik/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
#6 27.63 node-pre-gyp ERR! cwd /usr/lib/node_modules/kosmtik/node_modules/mapnik
#6 27.63 node-pre-gyp ERR! node -v v10.19.0
#6 27.63 node-pre-gyp ERR! node-pre-gyp -v v1.0.10
#6 27.63 node-pre-gyp ERR! not ok
#6 27.63 Failed to execute '/usr/bin/node /usr/bin/node-gyp configure --fallback-to-build --module=/usr/lib/node_modules/kosmtik/node_modules/mapnik/lib/binding/mapnik.node --module_name=mapnik --module_path=/usr/lib/node_modules/kosmtik/node_modules/mapnik/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
#6 28.18 npm ERR! code ELIFECYCLE
#6 28.18 npm ERR! errno 1
#6 28.18 npm ERR! mapnik@4.5.9 install: `node-pre-gyp install --fallback-to-build`
#6 28.18 npm ERR! Exit status 1
#6 28.18 npm ERR!
#6 28.18 npm ERR! Failed at the mapnik@4.5.9 install script.
#6 28.18 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#6 28.20
#6 28.20 npm ERR! A complete log of this run can be found in:
#6 28.20 npm ERR!     /root/.npm/_logs/2022-10-10T14_31_30_197Z-debug.log
------
executor failed running [/bin/sh -c npm set prefix /usr && npm install -g "git+https://git@github.com/kosmtik/kosmtik.git#f176c4c"]: exit code: 1
ERROR: Service 'kosmtik' failed to build : Build failed
ImreSamu commented 1 year ago

imho:

kyleAtQuantifind commented 1 year ago

It seems adding --unsafe-perm to the end of RUN npm set prefix /usr && npm install -g "git+https://git@github.com/kosmtik/kosmtik.git#f176c4c" in the Dockerfile solves it