Update: Alpine made a couple changes that affect this post, and a helpful comment below will clear up the issue(s) caused from that. Thanks Jonatha...
For further actions, you may consider blocking this person and/or reporting abuse
Just a note for anyone else that reads this and runs into this error:
This is because alpine recently moved the vips-dev package from
edge/testing
toedge/community
. See this issue for some context on thesharp
repo: github.com/lovell/sharp/issues/1733To fix it, just change the repo URL in the post above from:
http://dl-3.alpinelinux.org/alpine/edge/testing
tohttp://dl-3.alpinelinux.org/alpine/edge/community
.Also, I had to change the
--no-cache
in the second apk command to--update-cache
as is suggested in one of the referenced PRs off the above issue. So, your full dockerRUN
command for APK installs would look like this (formatting changed):Hope that helps someone else. It had me stuck for a while. :-P
In addition, yarn fails for me with the latest node (for alpine or otherwise). So, I also had to change the
FROM
line to fix it to the latest v8. E.g.,This doesn't work anymore. Also don't use edge, always pin down a stable version.
See more here: gitlab.alpinelinux.org/alpine/apor...
Change to version 3.10.
FYI: At the time of writing, Edge was the only option for this... and I really don't have time to keep this updated. Thanks for the heads up, I'll make another note at the top!
Here does not Work! Need to change python to python3. E.g.:
Awesome! Thanks for your super helpful comment, Jonathan! I'll be sure to make a note in the original post to see your comment.
Thanks for this :D
Very nice, thanks for putting this together, Daniel! One thing I really do encourage you is to define a
USER
, see also Node/Docker best practices and for the background canihaznonprivilegedcontainers.info.Hi Michael, thanks for the comment!
Would this actually be necessary for use in a local development setup like this? This is definitely not being used for production, by any stretch of imagination.
Not working for me
Hey Konstantin!
Thanks for the message. It looks like they are now including Yarn with the lastest versions of Alpine:Node, and it's throwing an error trying to re-install it. I'll get it corrected in just a moment or two. 💜
Thank you
How you resolve this error?
How you resolve this error?
Thanks for sharing.
I have tried in ubuntu host and encountered this error.
It's hard to say, but it looks like you may not have the
gatsby-transformer-remark
plugin installed and configured?Sidenote, possibly relevant: If you add any new packages to your app, you will need to rebuild your image using
docker-compose build
(ordocker-compose up --build
)Thanks for your reply. It is weired. There is no problem when I run
docker-compose up
in alpine linux host on VPS. Thanks anyway!Hi, Here the configuration that worked for me.
Then "serve" in package.json goes like this .
Hey Ernesto et all thanks for sharing,
When trying to run this i get stuck with the following error
"Recreating frontend_web_1 ... done
Attaching to frontend_web_1
web_1 | 2020-11-14T02:58:15: PM2 log: Launching in no daemon mode
web_1 | 2020-11-14T02:58:15: PM2 log: App [npm:0] starting in -fork mode-
web_1 | 2020-11-14T02:58:15: PM2 log: App [npm:0] online
web_1 | Usage: npm
web_1 | where is one of:"
that repeats itself until i get
"web_1 | 2020-11-14T02:58:24: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
web_1 | 2020-11-14T02:58:24: PM2 log: Script /usr/local/bin/npm had too many unstable restarts (16). Stopped. "errored"
web_1 | 2020-11-14T02:58:25: PM2 log: 0 application online, retry = 3
web_1 | 2020-11-14T02:58:27: PM2 log: 0 application online, retry = 2
web_1 | 2020-11-14T02:58:29: PM2 log: 0 application online, retry = 1
web_1 | 2020-11-14T02:58:31: PM2 log: 0 application online, retry = 0
web_1 | 2020-11-14T02:58:31: PM2 log: Stopping app:npm id:0
web_1 | 2020-11-14T02:58:31: PM2 error: app=npm id=0 does not have a pid
web_1 | 2020-11-14T02:58:31: PM2 log: PM2 successfully stopped"
Any ideas?
Many thanks
Hi Daniel!
Thanks for sharing!
I just copy-pasted all two files , run docker-compose -up build
and got the error:
Step 6/9 : COPY ./package.json .
ERROR: Service 'web' failed to build: COPY failed: stat /var/snap/docker/common/var-lib-docker/tmp/docker-builder603792599/package.json: no such file or directory
After this message installation stopped.
May be you have an idea how to fix?
Based on that error, it looks like there was no
package.json
file found.Do you have the
Dockerfile
anddocker-compose.yml
files in the root of your Gatsby project directory?Great post, thanks.
What's the command to run it?
No prob, Nick! Yeah, the code highlighting on this site isn't very visible, I know... you'll want to run:
docker-compose up
(from your project's root directory) :)So can i use vscode to code in gatsby without installing gastby globally on my local machine?
How will you setup your docker for production deployment with continuous build when the user add new post in wordpress ?