typo in 'Using bind mounts' section of getting started tutorial

Open
#358 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, node.js
Domain
documentation

Research direction

Start in the getting started tutorial's “Using bind mounts” section and compare the node:18-alpine commands with the Dockerfile's node:12-alpine base image. Reproduce the documented build, confirm which image and install command work together, then update both shell and PowerShell examples so the tutorial completes successfully.

Written by the indexing model from the issue text.

Description

The part of the tutorial that reads as below had me failing builds with a log full of g++ compiler errors for hours. The culprit was the 18-alpine. The tutorial starts off using 12-alpine (in its Dockerfile) then moves to 18 on this page (but does not suggest changing the Dockerfile). It then fails to find sqlite3 libraries on the image so tries to fetch binaries but in turn fails to find them. It falls back on a src compile which blasts out a spray of - mostly deprecation - warnings and finally chokes on a mismatched parameter (incompatible function params with a library by the looks). Changing the '18' to '12' makes the build work. Changing Dockerfile to 18 may also work - better minds than mine could confirm / correct. But I didn't try it anyway:

docker run -dp 3000:3000 \
    -w /app -v "$(pwd):/app" \
    node:**18**-alpine \
    sh -c "yarn install && yarn run dev"

If you are using PowerShell then use this command.

docker run -dp 3000:3000 `
    -w /app -v "$(pwd):/app" `
    node:**18**-alpine `
    sh -c "yarn install && yarn run dev"

I advise changing to:

> ```
> docker run -dp 3000:3000 \
>     -w /app -v "$(pwd):/app" \
>     node:**12**-alpine \
>     sh -c "apk --no-cache --virtual build-dependencies add python3 make g++ && yarn install && yarn run dev"
> ```
> 
> If you are using PowerShell then use this command.
> 
> ```
> docker run -dp 3000:3000 `
>     -w /app -v "$(pwd):/app" `
>     node:**12**-alpine `
>     sh -c "apk --no-cache --virtual build-dependencies add python3 make g++ && yarn install && yarn run dev"

Note: The final 'sh -c...' line is also different because I ran into the lack of python on the image as others have. But I see that's been fairly well covered online already.

Dominant language
JavaScript
Stars
3.1k
Forks
6.4k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docker/getting-started

All issues in docker/getting-started

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.