Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice to connect my own code into a standard docker image in kubernetes

I have a lot of standard runtime docker images like python3 with tensorflow 1.7 installed and I want to use these standard images to run some customers code out side of them. The scenario seems quite similar with the serverless. So what is the best way to put the code into runtime dockers?

Right now I am trying to use a persistent volume to mount the code into runtime. But it has a lot of work. Is there some solution easier for this?

UPDATE

What is the workflow for google machine learning engine or floydhub. I think what I want is similar. They have a command line tool to make the local code combine with a standard env.

like image 506
aisensiy Avatar asked May 09 '18 19:05

aisensiy


1 Answers

Following cloud native practices, code should be immutable, and releases and their dependencies uniquely identifiable for repeat-ability, replic-ability, etc - in short: you should really create images with your src code.

In your case, that would mean basing your Dockerfile on upstream python3 or TF images, there are a couple projects that may help with the workflow for above (code+build-release-run):

  • https://github.com/Azure/draft -- looks like better suited for your case
  • https://github.com/GoogleContainerTools/skaffold -- more golang friendly afaics

Hope it helps --jjo

like image 93
jjo Avatar answered Sep 19 '22 02:09

jjo