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

Doesn't actually include Gatsby? #24

Closed
polarathene opened this issue Dec 22, 2018 · 9 comments
Closed

Doesn't actually include Gatsby? #24

polarathene opened this issue Dec 22, 2018 · 9 comments
Labels

Comments

@polarathene
Copy link

This looks like it's just an nginx container? I'm trying to get a Docker container that works with v2 of Gatsby.

I have been using this container but it's a bit outdated. I ran into some issues but since it's running Gatsby v1.9.x and not ^2.0.0, I can't be sure that it's not already been fixed(afaik v2 introduced quite a few changes).

#11 (Gatsby CLI so it can be used for development) has been in discussion for a while and there is a PR that recently got some feedback but it's not clear if that'll be sussed out any time soon. So in the meantime I went to the PR repo and copied their Dockerfile, like I had tried with the prior one I had been using, but attempting to build both fails because of vips-dev requiring fttw3?

I'm going to give up on an alpine build as I've spent over 8 hours trying different Dockerfile changes to resolve the issue and get a working build but can't seem to get a container with v2 working :\

@polarathene
Copy link
Author

Seems it was an issue with the domain I've seen commonly used in alpine images to build/get the libvips packages. dl-cdn.alpinelinux.org was raising errors like this:

+ apk add --no-cache --update --repository https://dl-3.alpinelinux.org/alpine/edge/testing --repository https://dl-3.alpinelinux.org/alpine/edge/main vips-dev fftw-dev build-base
fetch https://dl-3.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
SSL certificate subject doesn't match host dl-3.alpinelinux.org
WARNING: Ignoring https://dl-3.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz: Permission denied
fetch https://dl-3.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
SSL certificate subject doesn't match host dl-3.alpinelinux.org
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
WARNING: Ignoring https://dl-3.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz: Permission denied
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz

After which I was given the unsatisfiable constraint for fttw3 that vips-dev package wanted. I didn't notice that the last repo used without error was 3.8, not edge, thus the problem.(I've tried building with both edge and 3.8 bases for a while). The sharp github repo has a note about installing libvips on alpine images which provided a url/domain that actually worked without errors:

RUN apk add vips-dev fftw-dev build-base --update-cache \
    --repository https://alpine.global.ssl.fastly.net/alpine/edge/testing/ \
    --repository https://alpine.global.ssl.fastly.net/alpine/edge/main

No errors with that one. If others don't get the errors that I did, it could be because of my location? I'm in China presently using ExpressVPN, no idea if either of those are affecting access.

@gatsbot gatsbot bot added the stale? label Feb 8, 2019
@gatsbot
Copy link

gatsbot bot commented Feb 8, 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! 💪💜

@polarathene
Copy link
Author

I did end up making a Docker Image with Alpine but haven't gotten around to putting it online. I believe I got it down to around 100MB, however working around the issues with binaries was still a pain.

  • Using the image to start a project, Gatsby would handle the git clone, but only if the project directory was empty. This prevented copying over the binaries prior into the node_modules directories, at the same time, it meant that the install would fail as binaries not compatible with alpine/musl failed their tests, they attempt to build from source(requires several hundred MB of dependencies added to image iirc), so copying the binaries after still required another install(where I think breakage still sometime occurs).
  • I also had breakage when sharp tried to pull it's alpine compatible binary, sometimes the transfer failed. I could provide a local copy for that. But I also ran into an Alpine specific bug with sharp/vips which was triggered when processing around 20 images(100-150MB) total, randomly segfaulting. This was fixed upstream but at the time sharp had not updated for it, it has since but afaik did not rebuild the Alpine binary.... so I built my own with a rather large multi-stage Dockerfile to mimic the sharp build script(due to any download/transfer for dependencies failing during the build would require restarting all over again, possibly an issue with China/VPN connection and the remote source)

Debian Stretch I also got an image working at around 200MB(no build tools), unfortunately it's dependencies are out of date(from 2015?), especially webp which didn't work, but I think it would work fine with binaries supplied by the npm packages. New release of Debian(Buster) should be out later this year. One issue I think specific to the debian image, was memory management/allocator? Alpine could run a Gatsby build on the image project(with the bugfixed version of vips/sharp), at under 500MB memory used, while Debian was going over 2GB and not releasing it until the container was exited iirc.

So uhh... probably best to avoid Alpine for dev, seems to be too much trouble if you want to avoid using edge(which prior Images for Gatsby had used and broken due to edge not being reliable/stable, basically same as :latest tag should be avoided). Just keep it simple without trying to deliver a lightweight image I guess?

Alternatively... have the entrypoint script handle what Gatsby new does instead?

@gatsbot
Copy link

gatsbot bot commented Feb 21, 2019

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

@gatsbot gatsbot bot closed this as completed Feb 21, 2019
@polarathene
Copy link
Author

polarathene commented Feb 22, 2019

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

It's been 12 days. Your math is broken @gatsbybot :(

Please feel free to reopen this issue or create a new one if you need anything else.

Doesn't appear to be possible for me to do?

@Kostanos
Copy link

hi, any advance on this issue

@polarathene
Copy link
Author

@Kostanos I don't think so beyond what I've shared. I think it's considered low priority due to there not appearing to be much demand for it. Getting a lightweight docker image isn't particularly trouble free, I have one that is around 100-150MB iirc with Alpine, but it's not a good experience. I have a debian one that's around 300-400MB(with build tools) I think, else you could just use a regular image such as pulling the official Node docker image and adding gatsby to it.

What particular needs do you have for Gatsby dev with Docker? Is the size of the image a concern? You will have to keep in mind to install any dependencies(npm/yarn) as you develop your project within the docker container, especially with Alpine as a base as you can run into incompatibility with what the host OS supports vs container OS.

@gatsbot
Copy link

gatsbot bot commented Mar 8, 2019

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

@gatsbot gatsbot bot closed this as completed Mar 8, 2019
@polarathene
Copy link
Author

@gatsbot you are relentless aren't you... and very bad at maths. HUMAN_EMOTION_CONFUSED

It's been 15 days since re-opened from you closing it and 12 days since the last activity on the issue. Please go to maintenance to be assessed for defects and repair.

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

No branches or pull requests

3 participants