简体   繁体   中英

Kubernetes and Dockerfile

People using Docker have probably used dockerfiles as master templates for their containers.

Does Kubernetes allow re-use of existing dockerfiles? Or will people need to port that to Kubernetes .yaml -style templates?

I'm not aware of tools for doing so or people that have been trying this.

Dockerfiles and the Kubernetes resource manifests (the yaml files) are somewhat orthogonal. While you could pull some information from the Dockerfile to prepopulate the Kubernetes manifest, it'd only be able to fill in a very small subset of the options available.

You can think of Dockerfiles as describing what is packaged into your container image, while the Kubernetes manifests specify how your container image is deployed -- which ports are exposed, environment variables are added, volumes are mounted, services made available to it; how it should be scheduled, health checked, restarted; what its resource requirements are; etc.

I think what you are referring to are your docker-compose files. These guys are responsible for orchestrating your 'service'. If you have docker-compose files there is a tool that can help convert them to k8 manifests.

https://github.com/kubernetes/kompose

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM