我正在尝试根据我的kompose文件创建一个部署,但是只要我尝试:
kompose convert -f docker-compose.yaml
我得到了错误:
Volume mount on the host "[file directory]" isn't supported - ignoring path on the host
我已经尝试了几种不同的解决方案,首先尝试将hostPath
添加到我的kompose convert
中,并使用持久卷,但是这两种方法都不起作用。
我的kompose文件如下:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -f docker-compose.yaml --volumes emptyDir
kompose.version: 1.7.0 (HEAD)
creationTimestamp: null
labels:
io.kompose.service: es01
name: es01
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: es01
spec:
containers:
- env:
- name: COMPOSE_CONVERT_WINDOWS_PATHS
value: "1"
- name: COMPOSE_PROJECT_NAME
value: elastic_search_container
- name: ES_JAVA_OPTS
value: -Xms7g -Xmx7g
- name: discovery.type
value: single-node
- name: node.name
value: es01
image: docker.elastic.co/elasticsearch/elasticsearch:7.2.1
name: es01
ports:
- containerPort: 9200
resources: {}
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: es01-empty0
restartPolicy: Always
volumes:
- emptyDir: {}
name: es01-empty0
status: {}
我正在使用kompose版本1.7.0
我的Docker Compose版本:
version: '3'
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.2.1
container_name: es01
environment:
- node.name=es01
- COMPOSE_PROJECT_NAME=elastic_search_container
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms7g -Xmx7g"
- COMPOSE_CONVERT_WINDOWS_PATHS=1
ulimits:
nproc: 3000
nofile: 65536
memlock: -1
volumes:
- /home/centos/Sprint0Demo/Servers/elasticsearch:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- kafka_demo