错误:来自守护程序的错误响应:无效的卷规范-Windows 8.1 Docker工具箱

时间:2019-06-06 07:16:19

标签: kubernetes kubernetes-helm

错误:来自守护程序的错误响应:无效的卷规范:'C:/ Users / Anthony / magento2-devbox:/ C:/ Users / Anthony / magento2-devbox'

我在此附近有个google,但我看不到这条路是如何组装的。大多数路径都排除了:,而且我也不确定为什么要组装此:/ C:/或是否只是为错误消息生成的。

这是副本集的YAML;

{
  "kind": "ReplicaSet",
  "apiVersion": "extensions/v1beta1",
  "metadata": {
    "name": "magento2-monolith-54cdd5b4b7",
    "namespace": "default",
    "selfLink": "/apis/extensions/v1beta1/namespaces/default/replicasets/magento2-monolith-54cdd5b4b7",
    "uid": "e819bfbd-8820-11e9-a613-080027316036",
    "resourceVersion": "22855",
    "generation": 1,
    "creationTimestamp": "2019-06-06T06:04:12Z",
    "labels": {
      "app.kubernetes.io/instance": "magento2",
      "app.kubernetes.io/name": "monolith",
      "pod-template-hash": "54cdd5b4b7"
    },
    "annotations": {
      "deployment.kubernetes.io/desired-replicas": "1",
      "deployment.kubernetes.io/max-replicas": "1",
      "deployment.kubernetes.io/revision": "1"
    },
    "ownerReferences": [
      {
        "apiVersion": "apps/v1",
        "kind": "Deployment",
        "name": "magento2-monolith",
        "uid": "9ec9d23e-8691-11e9-a3dd-080027316036",
        "controller": true,
        "blockOwnerDeletion": true
      }
    ]
  },
  "spec": {
    "replicas": 1,
    "selector": {
      "matchLabels": {
        "app.kubernetes.io/instance": "magento2",
        "app.kubernetes.io/name": "monolith",
        "pod-template-hash": "54cdd5b4b7"
      }
    },
    "template": {
      "metadata": {
        "creationTimestamp": null,
        "labels": {
          "app.kubernetes.io/instance": "magento2",
          "app.kubernetes.io/name": "monolith",
          "pod-template-hash": "54cdd5b4b7"
        }
      },
      "spec": {
        "volumes": [
          {
            "name": "nginx-config-volume",
            "configMap": {
              "name": "magento2-monolith-nginx-config",
              "defaultMode": 420
            }
          },
          {
            "name": "varnish-config-volume",
            "configMap": {
              "name": "magento2-monolith-varnish-config",
              "defaultMode": 420
            }
          },
          {
            "name": "code",
            "hostPath": {
              "path": "C:/Users/Anthony/magento2-devbox",
              "type": ""
            }
          }
        ],
        "containers": [
          {
            "name": "monolith",
            "image": "magento2-monolith:dev",
            "ports": [
              {
                "containerPort": 8050,
                "protocol": "TCP"
              }
            ],
            "env": [
              {
                "name": "DEVBOX_ROOT",
                "value": "C:/Users/Anthony/magento2-devbox"
              },
              {
                "name": "COMPOSER_HOME",
                "value": "C:/Users/Anthony/magento2-devbox/.composer"
              },
              {
                "name": "MAGENTO_ROOT",
                "value": "C:/Users/Anthony/magento2-devbox/magento"
              },
              {
                "name": "MAGENTO_ROOT_HOST",
                "value": "C:/Users/Anthony/magento2-devbox/magento"
              },
              {
                "name": "DEVBOX_ROOT_HOST",
                "value": "C:/Users/Anthony/magento2-devbox"
              },
              {
                "name": "IS_WINDOWS_HOST",
                "value": "0"
              }
            ],
            "resources": {},
            "volumeMounts": [
              {
                "name": "code",
                "mountPath": "C:/Users/Anthony/magento2-devbox"
              }
            ],
            "terminationMessagePath": "/dev/termination-log",
            "terminationMessagePolicy": "File",
            "imagePullPolicy": "Never",
            "securityContext": {
              "privileged": true,
              "procMount": "Default"
            }
          },
          {
            "name": "monolith-xdebug",
            "image": "magento2-monolith:dev-xdebug",
            "ports": [
              {
                "containerPort": 8002,
                "protocol": "TCP"
              }
            ],
            "env": [
              {
                "name": "DEVBOX_ROOT",
                "value": "C:/Users/Anthony/magento2-devbox"
              },
              {
                "name": "COMPOSER_HOME",
                "value": "C:/Users/Anthony/magento2-devbox/.composer"
              },
              {
                "name": "MAGENTO_ROOT",
                "value": "C:/Users/Anthony/magento2-devbox/magento"
              },
              {
                "name": "MAGENTO_ROOT_HOST",
                "value": "C:/Users/Anthony/magento2-devbox/magento"
              },
              {
                "name": "DEVBOX_ROOT_HOST",
                "value": "C:/Users/Anthony/magento2-devbox"
              },
              {
                "name": "IS_WINDOWS_HOST",
                "value": "0"
              }
            ],
            "resources": {},
            "volumeMounts": [
              {
                "name": "code",
                "mountPath": "C:/Users/Anthony/magento2-devbox"
              }
            ],
            "terminationMessagePath": "/dev/termination-log",
            "terminationMessagePolicy": "File",
            "imagePullPolicy": "Never",
            "securityContext": {
              "privileged": true,
              "procMount": "Default"
            }
          },
          {
            "name": "nginx",
            "image": "nginx:1.9",
            "resources": {},
            "volumeMounts": [
              {
                "name": "code",
                "mountPath": "C:/Users/Anthony/magento2-devbox"
              },
              {
                "name": "nginx-config-volume",
                "mountPath": "/etc/nginx/nginx.conf",
                "subPath": "nginx.conf"
              }
            ],
            "terminationMessagePath": "/dev/termination-log",
            "terminationMessagePolicy": "File",
            "imagePullPolicy": "IfNotPresent",
            "securityContext": {
              "privileged": true,
              "procMount": "Default"
            }
          },
          {
            "name": "varnish",
            "image": "million12/varnish",
            "env": [
              {
                "name": "VCL_CONFIG",
                "value": "/etc/varnish/magento.vcl"
              },
              {
                "name": "VARNISHD_PARAMS",
                "value": "-a 0.0.0.0:6081"
              }
            ],
            "resources": {},
            "volumeMounts": [
              {
                "name": "varnish-config-volume",
                "mountPath": "/etc/varnish/magento.vcl",
                "subPath": "varnish.vcl"
              }
            ],
            "terminationMessagePath": "/dev/termination-log",
            "terminationMessagePolicy": "File",
            "imagePullPolicy": "Always"
          }
        ],
        "restartPolicy": "Always",
        "terminationGracePeriodSeconds": 30,
        "dnsPolicy": "ClusterFirst",
        "securityContext": {},
        "schedulerName": "default-scheduler"
      }
    }
  },
  "status": {
    "replicas": 1,
    "fullyLabeledReplicas": 1,
    "observedGeneration": 1
  }
}

从Vagrant过来后,我是Docker / Kubernetes的新手,所以我不知道从哪里开始。我所拥有的信息来自Web浏览器仪表板

1 个答案:

答案 0 :(得分:1)

路径可能未转换为Unix样式。从docker 1.9.0开始,Windows路径不会自动转换(例如C:\ Users到/ c / Users)。

所以您的路径应该像:

{
   "name": "DEVBOX_ROOT",
   "value": "/c/Users/Anthony/magento2-devbox"
}