Can i add local file to an dockerhub image, without crerting a new image?

I have 2 naive noob questions slight_smile: if they were answered somwhere, sorry and please, give me a link :
Here is my szenario : i have dockerhub image, and have to host a pod from that image with additional file on the pod. (configuration file)
I know i can do that with kubectl cp after the pod is running, but … can i allready host a pod WITH the file in it ?
Second Question (kinda trying to solve the first one :slight_smile:
I can create a docker image localy. Can i use it in a kubernetes yaml file, WITHOUT upploading it to a image registry first ?
Because somebody would ask “but why?” :Because of company policies, it is a bit pain in the
“bottom part of your body” to create and upload a new docker image for further usage.
TL;DR :

  • Can i start a pod with files from that place, where i run the kubectl command ?
  • Can i use localy created docker image in kubecctl, WITHOUT uploading it to image registry first ?

Thanks and have a good day everyone :slight_smile:

No, they must be present as a configmap or volume ahead of time. You could do something like use a nfs share and mount it so you can change it out outside of the pod/configmap etc.

It might be a pain, but policy is likely there for a reason, and side-loading them would probably violate that policy. =/

On the technical side, you’d need to export the image and load it on all the hosts (e.g. scp + docker load) to do something like that then set the imagePullPolicy to IfNotPresent or Never.

Thanks for the explanaition !

For production, we would use image registry and make it the right way.

It is that just now, i have a POC, and after it is done, im afraid to forget to delete the image from registry, thats why i was searching for a “Quick and dirty” solution :slight_smile:

So if i understand it correctly, i can put the file in config map or volume, and use it then in pod.yaml for example.