Giter Site home page Giter Site logo

gatsby-docker's People

Contributors

aripalo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gatsby-docker's Issues

How to run a local project

Hi, could you please show me the command to dockerize a local project? the following always create a new starter gatsby site.

docker run -it --rm -v $(pwd)/.:/site -p 8000:8000 aripalo/gatsby-docker develop

docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker develop

I'm running them in the root of my project, which has a package.json

Thanks

Not working on Linux

Hi !

I can't get to make it work on linux.
I'm struggling with user permission as generate files are root privileged and I'm not able to edit them from my host IDE.
Unless this problem, everything works like a charm.

Can you help ?

Building Docker image fails

Step 1/10 : FROM node:9.5-alpine
9.5-alpine: Pulling from library/node
605ce1bd3f31: Pull complete
5c0ee846ddbc: Pull complete
4273d9861593: Pull complete
Digest: sha256:50ae5f22356c5a0b0c0ea76d27a453b0baf577c61633aee25cea93dcacec1630
Status: Downloaded newer image for node:9.5-alpine
---> e90a5bfd29f6
Step 2/10 : EXPOSE 8000
---> Running in eba84000a15c
Removing intermediate container eba84000a15c
---> ee5238c013d1
Step 3/10 : RUN apk update && apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing vips-tools vips-dev fftw-dev gcc g++ make libc6-compat && apk add git && apk add python && rm -rf /var/cache/apk/*
---> Running in ca25cdd3e5b3
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
v3.6.3-56-ge3af38305d [http://dl-cdn.alpinelinux.org/alpine/v3.6/main]
v3.6.3-50-g43dd52bda8 [http://dl-cdn.alpinelinux.org/alpine/v3.6/community]
OK: 8443 distinct packages available
fetch http://dl-3.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
WARNING: This apk-tools is OLD! Some packages might not function properly.
ERROR: unsatisfiable constraints:
pc:fftw3 (missing):
required by: vips-dev-8.7.0-r0[pc:fftw3]
vips-dev-8.7.0-r0[pc:fftw3]
vips-dev-8.7.0-r0[pc:fftw3]

The command '/bin/sh -c apk update && apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing vips-tools vips-dev fftw-dev gcc g++ make libc6-compat && apk add git && apk add python && rm -rf /var/cache/apk/*' returned a non-zero code: 2

Using local GatbsyJS

Hi.. I've tried the example command and it worked nicely:
`docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker develop``

But when I try to build my own GatsbyJS project:
docker run -it --rm -v $(pwd)/.:/site -p 8000:8000 aripalo/gatsby-docker develop or build it fails with an error:
screen shot 2018-05-15 at 23 29 58

Do you have any idea of what's happening? Basically I just wish to build a public folder ( using gatsby build ) with docker.

Thanks!

RFC: use yarn instead of npm

Is there a reason to use npm install instead of yarn install in entrypoint.sh? You use yarn in your example in the readme ... and I currently have an issue with npm producing an error while installing detect-port (which yarn doesn't).

Cheers
Uwe

Add `gatsby-plugin-sharp` support?

Hi @aripalo, this looks great!

I tried installing gatsby-plugin-sharp, but it fails because it doesn't have all the tools available to build sharp and / or its dependencies. Luckily there is an Alpine image that contains those dependencies already - see https://github.com/lovell/sharp/blob/master/docs/install.md#docker

For some background - I've recently been experimenting with Docker images for building a documentation tool for Gatsby, so you can see an example of building a Gatsby friendly container there. Sadly my image is the standard full-fat Node.js / Ubuntu image.

For reference, I ran docker run -it --rm -v $(pwd)/site:/site aripalo/gatsby-docker yarn add gatsby-plugin-sharp

And the error output was:

error /site/node_modules/sharp: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /site/node_modules/sharp
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:166:21)
gyp ERR! System Linux 4.9.60-linuxkit-aufs
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /site/node_modules/sharp

gatsby-plugin-sharp error

Hi, I tried to run my gatsby project that uses gatsby-plugin-sharp, I typed in:

docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker develop

but I'm getting following error:

Error: Error loading shared library /site/node_modules/sharp/build/Release/sharp.node: Exec format error

Everything is working fine when I'm starting a new project without mentioned plugin. Does anyone know what I'm doing wrong?

eslint incompatible with node

Currently running the command in a clean repo results in this:

Command: docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker develop

Result:
image

The first thought before any in-depth investigation is that it pulls latest version of eslint, yet sticks to a given version of node; eventually node version became outdated in regard to the eslint one and this triggered. Could be as simple as updating the dockerfile to point to more up-to-date packages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.