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

Docker Build - Create a default Docker file if there is not one #444

Open
lholmquist opened this issue May 13, 2020 · 6 comments
Open

Docker Build - Create a default Docker file if there is not one #444

lholmquist opened this issue May 13, 2020 · 6 comments

Comments

@lholmquist
Copy link
Member

lholmquist commented May 13, 2020

If someone is using the --build.strategy=Docker flag, nodeshift will expect that they have supplied a Dockerfile with their source code.

It might be a nice feature to generate a very basic Dockerfile if they don't have one. We could base it off of this Dockerfile, which is how the Nodejs.org "dockerize a node app" article does it

We will need to determine what node image to default to. Most likely we could default to the s2i image we already default to, and the --dockerImage and --dockerTag flags could be used to overwrite that value and use any node.js docker image/tag

Do we also add the ability for someone to overwrite what the Dockerfile CMD does? I think the link i shared above uses server.js, but a user might want to change that. or at that point, do they create their own Dockerfile?

@helio-frota
Copy link
Member

I think the link i shared above uses server.js, but a user might want to change that. or at that point, do they create their own Dockerfile?

I think we can consider that as well, but if this start to get customizable more than two items, so better to let they create their own Dockerfile.

@lholmquist
Copy link
Member Author

I would say, the CMD and the FROM are the 2(or 3 if you include the version tag) things that a user should be able to customize if using the default dockerfile that nodeshift would create.

@helio-frota helio-frota self-assigned this May 26, 2020
@lholmquist lholmquist added this to Backlog in Tooling and Modules May 27, 2020
@helio-frota
Copy link
Member

helio-frota commented May 28, 2020

One thing I noticed is that we need to add Dockerfile in files section of package.json

  "files": [
    "index.js",
    "Dockerfile"
  ]

@helio-frota
Copy link
Member

Probably there is a way to add the Dockerfile to the tar file without expect the user and/or nodeshift change package.json of the app.

@lholmquist
Copy link
Member Author

If the user choose the path were we are creating a Dockerfile for them, then we can just add it to the tar file when we create it and don't need to worry about adding anything to their package.json

If they already have a Dockerfile and want to use that, then they need to make sure they add it to their files property

@helio-frota
Copy link
Member

It took me a while to understand what was going on with:
#453

I'm using the following files section inside an example app:

  "files": [
    "index.js"
  ]

@lholmquist lholmquist moved this from Backlog to In progress in Tooling and Modules Jun 10, 2020
@helio-frota helio-frota removed their assignment Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Tooling and Modules
  
In progress
Development

No branches or pull requests

2 participants