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

Gatsby CLI #11

Closed
davidbarratt opened this issue Feb 4, 2018 · 9 comments
Closed

Gatsby CLI #11

davidbarratt opened this issue Feb 4, 2018 · 9 comments
Labels

Comments

@davidbarratt
Copy link

It would be really helpful if there was a Gatsby CLI image, similar to something like the Composer image.

That way you can use the CLI image to build the site in a multi-stage build.

@cusspvz
Copy link
Contributor

cusspvz commented Feb 5, 2018

@KyleAMathews we can do it. Have you though about it?

@KyleAMathews
Copy link
Contributor

This would be great to see! I haven't looked into doing this though.

@davidbarratt
Copy link
Author

Somewhat related if you run a container with gatsby develop gatsbyjs/gatsby#4478

@mrhut10
Copy link

mrhut10 commented Jul 2, 2018

if we had the gatsby-cli build in, would that allow us to generate a new project with the docker image,

and if so whats the easiest way to get those files back out, export them to host or bind mount volume?

regards

@cusspvz
Copy link
Contributor

cusspvz commented Jul 3, 2018

and if so whats the easiest way to get those files back out, export them to host or bind mount volume?

For the builder to be able to build another docker image, we would need to integrate docker in docker. So I was wondering if we could build a basic image just with the cli and a default path where users could mount their project folder in. From there, the only purpose of it would be just the public/ folder / build and other CLI commands such as develop.

This would be compatible with most of the CI/CD systems that are docker friendly.
A manual command would be something similar with this:

# docker run -ti --rm -v ~/project/x:/app gatsby/cli [options]
docker run -ti --rm gatsby/cli --help

# static build
docker run -ti --rm -v ~/project/x:/app gatsby/cli build

# dev usage
docker run -ti --rm -v ~/project/x:/app gatsby/cli develop

@mrhut10 do you have any other ideas?

@mrhut10
Copy link

mrhut10 commented Jul 3, 2018

@cusspvz mmm, I wasn't talking about the initial build process, but the initial setup of a new project, using docker. i.e. creating a new gatsby project.

However your commands you just mentioned with the mounted volumes might make that easy anyway seeing the created project files will end up back on the host. I'll try them out now and see. :)

@mrhut10
Copy link

mrhut10 commented Jul 6, 2018

@cusspvz i was using your run command with the mounted project volume, and with a small change works well for me.
-v "$(pwd)"/src:/source
and until i work out #16 i'm using node:slim and just adding the gatsby-cli this way

'RUN npm install --global gatsby-cli'

@gatsbot
Copy link

gatsbot bot commented Jan 24, 2019

Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!

@gatsbot
Copy link

gatsbot bot commented Feb 4, 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!

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

4 participants