docker / getting-started

Getting started with Docker
Apache License 2.0
2.91k stars 6.4k forks source link

When I execute "docker build -t getting-started ." . The following error occurred! #370

Closed wangfeijian closed 9 months ago

wangfeijian commented 1 year ago

(base) PS D:\Study\docker\getting-started\app> docker build -t getting-started . [+] Building 87.5s (9/9) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 184B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/node:18-alpine 1.2s => [1/5] FROM docker.io/library/node:18-alpine@sha256:f605fcd5254d0e398e04d93c7b11e2aec2a6e1aeb7da1f99bc40cd101dd8cde4 0.0s => [internal] load build context 13.0s => => transferring context: 2.64MB 12.8s => CACHED [2/5] WORKDIR /app 0.0s => [3/5] COPY . . 4.9s => [4/5] RUN yarn config set strict-ssl false -g 1.3s => ERROR [5/5] RUN yarn install --production 67.0s

[5/5] RUN yarn install --production:

9 0.950 yarn install v1.22.19

9 1.029 [1/4] Resolving packages...

9 1.338 [2/4] Fetching packages...

9 58.28 [3/4] Linking dependencies...

9 64.00 [4/4] Building fresh packages...

9 66.85 error /app/node_modules/sqlite3: Command failed.

9 66.85 Exit code: 1

9 66.85 Command: node-pre-gyp install --fallback-to-build

9 66.85 Arguments:

9 66.85 Directory: /app/node_modules/sqlite3

9 66.85 Output:

9 66.85 node-pre-gyp info it worked if it ends with ok

9 66.85 node-pre-gyp info using node-pre-gyp@0.11.0

9 66.85 node-pre-gyp info using node@18.15.0 | linux | x64

9 66.85 node-pre-gyp WARN Using request for node-pre-gyp https download

9 66.85 node-pre-gyp info check checked for "/app/node_modules/sqlite3/lib/binding/node-v108-linux-x64/node_sqlite3.node" (not found)

9 66.85 node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.0/node-v108-linux-x64.tar.gz

9 66.85 node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.0/node-v108-linux-x64.tar.gz

9 66.85 node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.0/node-v108-linux-x64.tar.gz

9 66.85 node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.1.0 and node@18.15.0 (node-v108 ABI, musl) (falling back to source compile with node-gyp)

9 66.85 node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.0/node-v108-linux-x64.tar.gz

9 66.85 gyp info it worked if it ends with ok

9 66.85 gyp info using node-gyp@9.3.1

9 66.85 gyp info using node@18.15.0 | linux | x64

9 66.85 gyp info ok

9 66.85 gyp info it worked if it ends with ok

9 66.85 gyp info using node-gyp@9.3.1

9 66.85 gyp info using node@18.15.0 | linux | x64

9 66.85 gyp ERR! find Python

9 66.85 gyp ERR! find Python Python is not set from command line or npm configuration

9 66.85 gyp ERR! find Python Python is not set from environment variable PYTHON

9 66.85 gyp ERR! find Python checking if "python3" can be used

9 66.85 gyp ERR! find Python - "python3" is not in PATH or produced an error

9 66.85 gyp ERR! find Python checking if "python" can be used

9 66.85 gyp ERR! find Python - "python" is not in PATH or produced an error

9 66.85 gyp ERR! find Python

9 66.85 gyp ERR! find Python **

9 66.85 gyp ERR! find Python You need to install the latest version of Python.

9 66.85 gyp ERR! find Python Node-gyp should be able to find and use Python. If not,

9 66.85 gyp ERR! find Python you can try one of the following options:

9 66.85 gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"

9 66.85 gyp ERR! find Python (accepted by both node-gyp and npm)

9 66.85 gyp ERR! find Python - Set the environment variable PYTHON

9 66.85 gyp ERR! find Python - Set the npm configuration variable python:

9 66.85 gyp ERR! find Python npm config set python "/path/to/pythonexecutable"

9 66.85 gyp ERR! find Python For more information consult the documentation at:

9 66.85 gyp ERR! find Python https://github.com/nodejs/node-gyp#installation

9 66.85 gyp ERR! find Python **

9 66.85 gyp ERR! find Python

9 66.85 gyp ERR! configure error

9 66.85 gyp ERR! stack Error: Could not find any Python installation to use

9 66.85 gyp ERR! stack at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)

9 66.85 gyp ERR! stack at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)

9 66.85 gyp ERR! stack at PythonFinder. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)

9 66.85 gyp ERR! stack at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)

9 66.85 gyp ERR! stack at exithandler (node:child_process:427:5)

9 66.85 gyp ERR! stack at ChildProcess.errorhandler (node:child_process:439:5)

9 66.85 gyp ERR! stack at ChildProcess.emit (node:events:513:28)

9 66.85 gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:289:12)

9 66.85 gyp ERR! stack at onErrorNT (node:internal/child_process:476:16)

9 66.85 gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

9 66.85 gyp ERR! System Linux 5.10.16.3-microsoft-standard-WSL2

9 66.85 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/app/node_modules/sqlite3/lib/binding/node-v108-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/app/node_modules/sqlite3/lib/binding/node-v108-linux-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"

9 66.85 gyp ERR! cwd /app/node_modules/sqlite3

9 66.85 gyp ERR! node -v v18.15.0

9 66.85 gyp ERR! node-gyp -v v9.3.1

9 66.85 gyp ERR! not ok

9 66.85 node-pre-gyp ERR! build error

9 66.85 node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/app/node_modules/sqlite3/lib/binding/node-v108-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/app/node_modules/sqlite3/lib/binding/node-v108-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)

9 66.85 node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)

9 66.85 node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)

9 66.85 node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5)

9 66.85 node-pre-gyp ERR! System Linux 5.10.16.3-microsoft-standard-WSL2

9 66.85 node-pre-gyp ERR! command "/usr/local/bin/node" "/app/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"

9 66.85 node-pre-gyp ERR! cwd /app/node_modules/sqlite3

9 66.85 node-pre-gyp ERR! node -v v18.15.0

9 66.85 node-pre-gyp ERR! node-pre-gyp -v v0.11.0

9 66.85 node-pre-gyp ERR! not ok

9 66.85 Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/app/node_modules/sqlite3/lib/binding/node-v108-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/app/node_modules/sqlite3/lib/binding/node-v108-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)

9 66.85 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.


executor failed running [/bin/sh -c yarn install --production]: exit code: 1

nnthuanegany commented 1 year ago
 docker compose -f docker-compose.prod.yml build
[+] Building 2.1s (4/4) FINISHED                                                                                                                                                                                                              
 => [internal] load build definition from Dockerfile                                                                                                                                                                                     0.1s
 => => transferring dockerfile: 1.53kB                                                                                                                                                                                                   0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                        0.1s
 => => transferring context: 112B                                                                                                                                                                                                        0.0s
 => ERROR [internal] load metadata for docker.io/library/build:latest                                                                                                                                                                    2.0s
 => [internal] load metadata for docker.io/library/node:18.15.0-alpine                                                                                                                                                                   0.0s
------
 > [internal] load metadata for docker.io/library/build:latest:
------
failed to solve: build: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed (did you mean builder?)
denano-yihua commented 1 year ago

I meet the same error. You can try the solution in https://github.com/docker/getting-started/issues/124 Another solution is use FROM node:18 instead of FROM node:18-alpine in Dockerfile

wangfeijian commented 1 year ago

I meet the same error. You can try the solution in #124 Another solution is use FROM node:18 instead of FROM node:18-alpine in Dockerfile

it doesn't work!!

GilbertTam commented 11 months ago

Use docker pull node:18-alpine at first. Details see -> https://hub.docker.com/_/node/tags?page=1&name=18-alpine