Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

[EPIC] create a command for creating docker images via kedge #273

Open
jstrachan opened this issue Sep 18, 2017 · 4 comments
Open

[EPIC] create a command for creating docker images via kedge #273

jstrachan opened this issue Sep 18, 2017 · 4 comments

Comments

@jstrachan
Copy link

jstrachan commented Sep 18, 2017

on the fabric8-maven-plugin we have to handle the case that:

  • the user is running on kubernetes or OpenShift with access to the docker socket; so perform docker builds via the docker CLI tool using a Dockerfile (or a default ONBUILD Dockerfile for various standard languages like node / go / dot net etc). e.g. https://github.com/fabric8io/fabric8-jenkinsfile-library/blob/master/golang/ReleaseAndStage/Jenkinsfile#L12-L13
  • the user is running on OpenShift without access to the docker socket; then either
    • use a S2I binary build (generating the BuildConfig on the fly) and POST the tarball of the binary to use
    • use a docker build in OpenShift (generating the BuildConfig on the fly)

It might be nice to add this logic into kedge so that folks can build images on kubernetes or openshift using other languages/frameworks/build tools other than Java + maven + fabric8-maven-plugin. Then after a language specific build tool (make / npm / grunt / gulp / gradle / whatever) has created the binary or artefact(s) and we just need to take the generated file(s) and create the docker image using whatever strategy suits the current cluster.

So something like

$ kedge build --dockerfile=Dockerfile myuser/myimage:${VERSION} ./build/mybinary
Running on OpenShift so defaulting to using S2I build
Generated foo-s2i
Building....
Image created: myuser/myimage:1.2.3

Starting with vanilla support for running the necessary docker or oc CLI tools would be a good start.

Later on it might be nice to also support the Google Container Builder too: https://cloud.google.com/container-builder/docs/ for folks using kubernetes

@surajssd
Copy link
Member

I would like to take a stab at the build story for kedge!

@surajssd
Copy link
Member

This needs to be discussed though, with one approach at a time.

@pradeepto
Copy link
Member

@surajssd We probably will have to break this task into smaller tasks before you start implementing it.

@jstrachan
Copy link
Author

jstrachan commented Sep 20, 2017

yeah, we could separate out the different strategies...

  • lazily create if required a S2I binary build on the fly (like fabric8-maven-plugin's build goal does if using OpenShift)
  • use the OpenShift Docker binary build strategy if its available (usually its not) ;)
  • use the docker socket if its available (e.g. on kubernetes) and use the docker build CLI to do it
  • use Google Container Builder
  • if buildah is ever usable inside a build pod in openshift/kubernetes (again not for a while by the sounds of it) - we could use that too https://github.com/projectatomic/buildah

@concaf concaf mentioned this issue Sep 20, 2017
@surajssd surajssd removed this from the 0.3.0 milestone Oct 2, 2017
@pradeepto pradeepto changed the title create a command for creating docker images via kedge [EPIC] create a command for creating docker images via kedge Oct 2, 2017
@surajssd surajssd removed their assignment Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants