Skip to content
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

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Conversation

TylerZeroMaster
Copy link
Contributor

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.

  • Add new compose file for exercises
  • Update dockerfile to use debian bookworm and node 12
  • Listen on 0.0.0.0 instead of localhost
    • localhost in docker refers to the container's localhost, not the host machine's. Alternative solution: set OX_PROJECT_HOST to host.docker.internal (documentation)

    - Add new compose file for exercises
    - Update dockerfile to use debian bookworm and node 12
    - Listen on 0.0.0.0 instead of localhost
@TylerZeroMaster TylerZeroMaster requested a review from a team as a code owner January 29, 2024 15:34
@TylerZeroMaster TylerZeroMaster requested review from jivey, philschatz, therealmarv and sparksam and removed request for a team and jivey January 29, 2024 15:34
@TylerZeroMaster TylerZeroMaster self-assigned this Jan 29, 2024
Copy link
Member

@philschatz philschatz left a 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

@philschatz philschatz self-requested a review January 31, 2024 20:55
Copy link
Member

@philschatz philschatz left a 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

@TylerZeroMaster
Copy link
Contributor Author

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 troubleshooting section in docker-quickstart.md.

@TylerZeroMaster TylerZeroMaster merged commit 159415b into main Jan 31, 2024
5 of 6 checks passed
@TylerZeroMaster TylerZeroMaster deleted the update-docker branch January 31, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants