gatsbyjs / gatsby-docker

Docker image that builds and hosts a Gatsby site
MIT License
356 stars 88 forks source link

Doesn't actually include Gatsby? #24

Closed polarathene closed 5 years ago

polarathene commented 5 years ago

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 commented 5 years ago

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[bot] commented 5 years ago

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 commented 5 years ago

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.

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[bot] commented 5 years ago

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!

polarathene commented 5 years ago

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 commented 5 years ago

hi, any advance on this issue

polarathene commented 5 years ago

@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[bot] commented 5 years ago

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!

polarathene commented 5 years ago

@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.