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

Auto-detect base image to use if no Dockerfile is found #84

Open
sr229 opened this issue Jul 2, 2018 · 1 comment
Open

Auto-detect base image to use if no Dockerfile is found #84

sr229 opened this issue Jul 2, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@sr229
Copy link

sr229 commented Jul 2, 2018

Summary

In layman's terms: It should be able to allow developers to git push to a gitkube-enabled cluster without a Dockerfile - or so called the "Heroku-style" deployment.

Intro

Heroku's architecture is composed of a dedicated builder for the source, where your project requires a Procfile to determine processes to execute, and a declarative app manifest that includes all the required dependencies and postinstall scripts that the builder will run.

Heroku builds an app using an approach called a Stack-Buildpack approach, whereas:

  • use a Base image that has all the dev dependencies.
  • use a Buildpack: a set of shell scripts that would automate the building and releasing of the code
  • trim dev dependencies from the container and release to the runtime environment.

But in the case for gitkube, we do not need to implement the same flow as Heroku since we can take advantage of the rich Docker ecosystem in Kubernetes.

Process flow

Once the remote recieves the source from the push, it should be able to detect the dockerfile and the manifest, but we should look on two situations:

  • Situation 1: Dockerfile found and manifest found.
    • Use the current flow to dpeloy app.
  • Situation 2: Dockerfile not found but manifest found
    • Try to find manifest (package.json, pom.xml, etc.).
    • Grab image that works for the specific app (package.json is found for example, then use nodejs:latest)
    • then run npm install, and deploy app.
    • run code using npm start or find app.js, index.js, etc.
      • if not found, declare an error and call a back off.

Conclusion

This is not intended to replace how gitkube currently works, rather, it is a enhancement on the current flow, and it allows migrating users from Heroku to their own provisioned Kubernetes cluster.

Feel free to extend this as well, as I only accounted for cases on migrating users from heroku.

@shahidhk shahidhk added the enhancement New feature or request label Jul 2, 2018
@shahidhk shahidhk changed the title [Feature Request] Auto-detect base image to use if no Dockerfile is found Auto-detect base image to use if no Dockerfile is found Jul 2, 2018
@blopker
Copy link

blopker commented Aug 24, 2018

Dokku uses https://github.com/gliderlabs/herokuish to run the build packs. Could be an interesting combination with this project.

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

No branches or pull requests

3 participants