Skip to content
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

CLI / Dev image #25

Open
polarathene opened this issue Feb 22, 2019 · 10 comments
Open

CLI / Dev image #25

polarathene opened this issue Feb 22, 2019 · 10 comments

Comments

@polarathene
Copy link

Image doesn't actually provide Gatsby in a way that can be used for development via Docker.

@gatsbybot has closed two similar issues. It's a bit broken as it closes issues regardless of activity and states you can re-open the issue, but the issue author is not able to actually do so.

#11
#24

Should be noted that alpine isn't a good candidate for dev image at present. Numerous issues detailed in the related PR. Official node images have debian stretch slim available, it should work alright despite having packages a fair bit outdated(2015), Buster will arrive later this year. Official node images are also considering adding Ubuntu as a base option too.

@gatsbot
Copy link

gatsbot bot commented Mar 15, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@kanolato
Copy link
Contributor

kanolato commented Mar 25, 2019

@polarathene I opened a PR #26 , maybe you could check it and help me improve the current Docker Image

@cdaringe
Copy link

Docker image that builds and hosts a Gatsby site

agreed with the above comments. the current doesnt build. the first step in the instructions conflictingly say "build your assets" then copy 'em in

@polarathene
Copy link
Author

@cdaringe #26 was merged which updates the onbuild image to build the project and uses Debian Buster, so that should handle that purpose better.

A development image still needs to be supplied, although I imagine there is less demand for that, will keep this issue open if anyone wants to tackle that.

@mattvonrocketstein
Copy link

agree with OP, this image is not usable for any of the things everyone will expect it to be useful for.

$ docker run -it -v `pwd`:/workspace -w /workspace --entrypoint bash gatsbyjs/gatsby
bash-5.0# npm
bash: npm: command not found
bash-5.0# node
bash: node: command not found
bash-5.0# gatsby
bash: gatsby: command not found

@TomFaulkner
Copy link

Came here looking for a dev image. So, a bump for this issue. :)

@polarathene
Copy link
Author

Technically, you could probably just use a nodejs docker image and mount a local data volume that has gatsby installed? Might want another volume for the package cache or configure npm/yarn to use a dir in the mounted volume. Wouldn't be too different to what you'd want from a dev image?

Buster is available now, so the outdated packages for things like webp issue isn't an issue anymore. Not sure if npm package linux support for image libs improved to handle Alpine or not, I'm assuming not.

@TomFaulkner
Copy link

I was looking for this after having problems getting Gatsby to install and work on a Ubuntu 20.04 distribution (Pop). I ended up using this and modifying the Dockerfile to use it to create a new site as well. https://www.stoutlabs.com/blog/2019-02-05-my-docker-setup-gatsby-next/

@yukihiko-shinoda
Copy link

I built docker image for Gatsby development and wrote procedure manual:
futureys/gatsby - Docker Hub

If anyone wants to fork to customize, Dockerfile is here:
yukihiko-shinoda/dockerfile-gatsby: Dockerfile for Gatsby.

I could develop Gatsby site with this image.
Isn't this also be your helps?
I'm searching response maybe I don't know the details of development in Gatsby since I'm first time to develop Gatsby site.
And if Gatsby official have plan to maintain Docker image for Gatsby development,
where should I submit these code?

@polarathene
Copy link
Author

if Gatsby official have plan to maintain Docker image for Gatsby development,

I am not aware of official gatsby devs caring too much for the maintenance of Docker images here. They probably have no plans for such but wouldn't be against one being contributed here.

where should I submit these code?

This is the correct repo to submit a PR to, however it would need to pass review. I am a bit busy until sometime next month to properly evaluate your Docker image, I do recall alpine linux having a problem with some packages Gatsby uses, you have added gcc which should remedy that issue (imagemin packages I think).

You seem to add a bunch of packages for mozjpeg which is an optional package and shouldn't matter too much for a development image, what I do remember is those dependencies are for an older version of mozjpeg, if they're still relevant then the package providing mozjpeg is using an old version and not been updated, here's a docker image with alpine that builds mozjpeg.

There is an existing PR in this repo that had a good approach to a dev image, the entrypoint script made it useful. I believe back then vips wasn't available as a stable package and wasn't good to build, that's changed since.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants