是否有办法在k8s上运行docker-compose应用程序?
目前我的docker-compose的内容。Yml文件如下:
version: "3"
services:
registry:
restart: always
image: registry:2
ports:
- 5000:5000
environment:
REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt
REGISTRY_HTTP_TLS_KEY: /certs/domain.key
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
volumes:
- /home/app/docker/test/data:/var/lib/registry
- /home/app/docker/test/certs:/certs
- /home/app/docker/test/auth:/auth
nginx:
container_name: "nginx"
build:
context: ./nginx
dockerfile: Dockerfile
ports:
- '80:80'
depends_on:
- node
node:
container_name: "node"
build:
context: ./web
dockerfile: Dockerfile
volumes:
- ./volumes/index.html:/usr/src/node/index.html
expose:
- "3000"
你能改变这与k8s工作吗?
Try Kompose(github)
kompose convert -f docker-compose.yaml
不确定是否有简单的方法来做到这一点,但我听说有一个叫做Kompose的工具可能会帮助你(我从未尝试过)