-
Notifications
You must be signed in to change notification settings - Fork 88
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
Improve Docker image #26
Conversation
update the example dockerfile
update README.md
Ok. So these changes create this flow:
Why was the port changed from This change while nice, will prevent existing users of the current workflow from being able to avoid the build within the container and debugging anything that may go wrong. Perhaps this contribution should rather compliment the existing offering? This doesn't solve #25, as that's about a development image. One that doesn't require building an image locally for every change.
What has your PR done to resolve that? Both end up serving nginx from the same main gatsby alpine image? |
@kanolato I am in agreement with @polarathene's comments - are you able to update this PR and maybe it could get merged? |
Going to update it in the following days :) @JaKXz |
ONBUILD WORKDIR /app | ||
ONBUILD ADD . ./ | ||
ONBUILD RUN yarn | ||
ONBUILD RUN gatsby build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for most gatsby users, i suspect this new file will be missing required system dependencies for native compile steps from core-js|cwebp|sharp|etc used in the gatsby build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I'm not getting it, wich new file are you referring to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean this deps should also be added to the image? core-js|cwebp|sharp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct. those things have native compile toolchains, of which the support libraries required for such installations i suspect are not present in this image. gatsby will eventually try and use node-native bindings to hook into them on build, but would not be found. thus, i suggest gatsby build
would fail
Than you all for your comments!. The required changes were just pushed. |
IIRC, stretch image dependencies were out of date, especially cwebp. Since Buster has been out for a while, perhaps better to switch to that. |
I have changed to buster and upgrade node to 12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for taking the time to contribute the improvements! 😄
Holy buckets, @kanolato — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
When im using Docker i like that i dont have to install anything else but Docker. I thought that it would be nice to build the project in
gatsbyjs/gatsby:onbuild
and then just copy the public dir togatsbyjs/gatsby
. Now as the documentation says the:onbuild
tag builds the project and:latest
serves it.Also i first tried to use the image as the documentation but the
:onbuild
tag lacks of nginx rules and every request gets a500
.#25