-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docker configuration for exercises #3907
Conversation
- Add new compose file for exercises - Update dockerfile to use debian bookworm and node 12 - Listen on 0.0.0.0 instead of localhost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that python might still be required to build node-sass (at least on some architectures):
Click me to expand
$ docker-compose -f docker-compose.exercises.yml up
(...)
build_1 | [5/5] Building fresh packages...
build_1 | info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
build_1 | error /code/node_modules/node-sass: Command failed.
build_1 | Exit code: 1
build_1 | Command: node scripts/build.js
build_1 | Arguments:
build_1 | Directory: /code/node_modules/node-sass
build_1 | Output:
build_1 | Building: /usr/local/bin/node /code/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
build_1 | gyp info it worked if it ends with ok
build_1 | gyp verb cli [
build_1 | gyp verb cli '/usr/local/bin/node',
build_1 | gyp verb cli '/code/node_modules/node-gyp/bin/node-gyp.js',
build_1 | gyp verb cli 'rebuild',
build_1 | gyp verb cli '--verbose',
build_1 | gyp verb cli '--libsass_ext=',
build_1 | gyp verb cli '--libsass_cflags=',
build_1 | gyp verb cli '--libsass_ldflags=',
build_1 | gyp verb cli '--libsass_library='
build_1 | gyp verb cli ]
build_1 | gyp info using node-gyp@7.1.2
build_1 | gyp info using node@18.19.0 | linux | x64
build_1 | gyp verb command rebuild []
build_1 | gyp verb command clean []
build_1 | gyp verb clean removing "build" directory
build_1 | gyp verb command configure []
build_1 | gyp verb find Python Python is not set from command line or npm configuration
build_1 | gyp verb find Python Python is not set from environment variable PYTHON
build_1 | gyp verb find Python checking if "python3" can be used
build_1 | gyp verb find Python - executing "python3" to get executable path
build_1 | gyp verb find Python - "python3" is not in PATH or produced an error
build_1 | gyp verb find Python checking if "python" can be used
build_1 | gyp verb find Python - executing "python" to get executable path
build_1 | gyp verb find Python - "python" is not in PATH or produced an error
build_1 | gyp verb find Python checking if "python2" can be used
build_1 | gyp verb find Python - executing "python2" to get executable path
build_1 | gyp verb find Python - "python2" is not in PATH or produced an error
build_1 | gyp ERR! find Python
build_1 | gyp ERR! find Python Python is not set from command line or npm configuration
build_1 | gyp ERR! find Python Python is not set from environment variable PYTHON
build_1 | gyp ERR! find Python checking if "python3" can be used
build_1 | gyp ERR! find Python - "python3" is not in PATH or produced an error
build_1 | gyp ERR! find Python checking if "python" can be used
build_1 | gyp ERR! find Python - "python" is not in PATH or produced an error
build_1 | gyp ERR! find Python checking if "python2" can be used
build_1 | gyp ERR! find Python - "python2" is not in PATH or produced an error
build_1 | gyp ERR! find Python
build_1 | gyp ERR! find Python **********************************************************
build_1 | gyp ERR! find Python You need to install the latest version of Python.
build_1 | gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
build_1 | gyp ERR! find Python you can try one of the following options:
build_1 | gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
build_1 | gyp ERR! find Python (accepted by both node-gyp and npm)
build_1 | gyp ERR! find Python - Set the environment variable PYTHON
build_1 | gyp ERR! find Python - Set the npm configuration variable python:
build_1 | gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
build_1 | gyp ERR! find Python For more information consult the documentation at:
build_1 | gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
build_1 | gyp ERR! find Python **********************************************************
build_1 | gyp ERR! find Python
build_1 | gyp ERR! configure error
build_1 | gyp ERR! stack Error: Could not find any Python installation to use
build_1 | gyp ERR! stack at PythonFinder.fail (/code/node_modules/node-gyp/lib/find-python.js:302:47)
build_1 | gyp ERR! stack at PythonFinder.runChecks (/code/node_modules/node-gyp/lib/find-python.js:136:21)
build_1 | gyp ERR! stack at PythonFinder.<anonymous> (/code/node_modules/node-gyp/lib/find-python.js:179:16)
build_1 | gyp ERR! stack at PythonFinder.execFileCallback (/code/node_modules/node-gyp/lib/find-python.js:266:16)
build_1 | gyp ERR! stack at exithandler (node:child_process:430:5)
build_1 | gyp ERR! stack at ChildProcess.errorhandler (node:child_process:442:5)
build_1 | gyp ERR! stack at ChildProcess.emit (node:events:517:28)
build_1 | gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:290:12)
build_1 | gyp ERR! stack at onErrorNT (node:internal/child_process:477:16)
build_1 | gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
build_1 | gyp ERR! System Linux 6.5.0-15-generic
build_1 | gyp ERR! command "/usr/local/bin/node" "/code/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
build_1 | gyp ERR! cwd /code/node_modules/node-sass
build_1 | gyp ERR! node -v v18.19.0
build_1 | gyp ERR! node-gyp -v v7.1.2
build_1 | gyp ERR! not ok
build_1 | Build failed with error code: 1
tutor-js_build_1 exited with code 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to run build first. Now it works for me!
docker-compose -f docker-compose.exercises.yml build
docker-compose -f docker-compose.exercises.yml up
That is great news! I added some additional clarification to the |
This is the configuration I have been using locally for a while now. This configuration uses the same node version, 12.22.12, as the aws code builder task and does not modify dependencies at all.
localhost
in docker refers to the container's localhost, not the host machine's. Alternative solution: setOX_PROJECT_HOST
tohost.docker.internal
(documentation)