Outdated version of string-width is causing the Docker image entrypoint loading to fail.
Issue Summary
The update to fix arm32 architecture (https://github.com/TryGhost/Ghost/commit/c2485af853f7b3b86f7f141b8496439cdc4881b4) introduce a regression in the way the Ghost package is launched. When running node index.js there is a module resolution error similar to this issue https://github.com/nrwl/nx/issues/19249. I managed to solve the issue locally by adding "string-width": "4.2.3" to the resolutions section.
Here is the Docker test showing the error: https://github.com/docker-library/ghost/actions/runs/8756974313/job/24034646549
I would like to contribute this fix but I am not sure which package.json to use because the packaged one seems to be generated from the source ones.
Steps to Reproduce
There is probably an more streamlined reproducible but building the Docker image here then running it (https://github.com/docker-library/ghost/tree/master/5/debian)
docker build -t ghost .
docker run --rm ghost
Ghost Version
5.82.3
Node.js Version
18., 20.
How did you install Ghost?
In Docker using the Ghost CLI
Database type
MySQL 5.7
Browser & OS version
No response
Relevant log / error output
No response
Code of Conduct
- [X] I agree to be friendly and polite to people in this repository
I'm also seeing this in my docker build. Let me know if I can help provide any more info 👍
Currently I'm using kubernetes and a different approach to the entrypoint. I'm using distroless node 20 debian 12 as the final stage, and the entrypoint is actually a nodejs script which moves the themes and then inits the main function to start ghost. At the moment I'm not having any issue at least with arm64. If it suits you, you can test it out too, because anyways it's still based on the "official" image (at least in the logic and general workflow of the dockerfile)
cc @acburdine :bow: :heart:
(this is currently blocking updates to the ghost Docker image :sob:)
cc @acburdine 🙇 ❤️
(this is currently blocking updates to the
ghostDocker image 😭)
Hope this helps (and works 😂) https://github.com/docker-library/ghost/pull/414
This is weird 🤔
We haven't been seeing this with our internal builds but I do know we've run into it a few times with local dev. I think yarn is hoisting different versions of string-width up to the root, but I'm not entirely sure why
Potentially related to https://github.com/isaacs/jackspeak/issues/5 + https://github.com/storybookjs/storybook/issues/22431#issuecomment-1630086092
This is weird 🤔
We haven't been seeing this with our internal builds but I do know we've run into it a few times with local dev. I think yarn is hoisting different versions of string-width up to the root, but I'm not entirely sure why
The script which runs their tests is where the CI fails, at least as my understanding, probably I0m wrong: https://github.com/ngeorger/ghost/actions/runs/9014939335/job/24768631225#step:7:16
My approach is a bit different, I'm using multi stage builds and running fine on Kubernetes, both arm64 and amd64.
Maybe this helps a bit :) https://github.com/sredevopsorg/ghost-on-kubernetes/blob/19c3c93ec92c9f728a0e99cbf03f5bc490a0e847/Dockerfile#L5
PS: I actually solved many crashes using yarn instead of npm, I guess uou are right :)
Regards from Chile!
Can people try using Yarn v1.22.22? Apparently they fixed the transitive dependencies bug in that: https://github.com/yarnpkg/yarn/releases/tag/v1.22.22
In fact, I think I'll just add a jackspeak resolution, as that solves it for most people
Let's give this a go 🙂 Let me know if it re-occurs
Does that mean the solution didn't work? Or do we need to wait for next release?
We need to wait for the release (should have checked the history log before opening the PR)
Yep sorry, next release (today)
JackSpeak resolution was not enough unfortunately https://github.com/docker-library/ghost/actions/runs/9063454953/job/24899459788#step:7:33
Latest version worked! Thanks all!
Glad we could get it fixed! Lockfiles hey 🙄