docker run -p 1313:1313 \
-v ${PWD}:/src \
hugomods/hugo \
hugo server --bind 0.0.0.0
I get this error log:
node:internal/modules/cjs/loader:1147
throw err;
^
Error: Cannot find module '/src/server'
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v21.4.0
If I do:
docker run \
-v ${PWD}:/src \
hugomods/hugo \
npm i
I get:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /src/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/src/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-01-02T12_39_55_260Z-debug-0.log
As the image shown, the command should be hugo server instead of server, Previously, some users whose switch from klakegg/docker-hugo image also encountered related issues, but hugomods/hugo doesn’t mapping hugo commands, e.g. server to hugo server.
version: '3'
services:
hugo:
image: hugomods/hugo:latest
ports:
- 1313:1313
volumes:
- /home/username/dockers/my-web-name:/src
command: hugo server --buildDrafts --buildFuture --bind 0.0.0.0
And, I created a basic hugo.yaml on that my-web-name folder.
Do you think the compose is fine?
The docker seems to keep running fine now.
But 3 other new dockers appear (not shown with docker ps but I can see them exited in portainer):
bold_mccarthy
eloquent_kapitsa
pedantic_jennings
I can see different errors on the logs for them (one has the NPM errors from previous posts… other the error about the config file…). No one of them is running.
Is that expected?
Also, how do you enter that docker terminal?
docker exec -u 33 -it hugo-hugo-1 /bin/bash
OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown
Hmm, that docker image does not include android module/CLI, I think you’ve to install it by some way, I don’t know react native, could not provide further help on it.