【问题标题】:Postgres in WSL 2 with Docker - Operation not permitted when I share volumes enter windows folder带有 Docker 的 WSL 2 中的 Postgres - 当我共享卷进入 windows 文件夹时不允许操作
【发布时间】:2020-04-10 08:16:09
【问题描述】:

WSL 2 中的 Postgres - : 当我共享卷进入 windows 文件夹时不允许操作。

我正在使用 Windows WSL2 子系统在 VM 上模拟 Linux。

我在将 linux 卷共享到 Windows 上的文件夹时遇到问题。

WSL 在 mnt 中建立了一个 c 目录。我正在尝试使用这个目录来创建 Docker 卷。

当我在 file compose 上卸载卷时不会出现此问题。

我相信一定是windows文件夹里有权限的东西。

谢谢

version: "3.6"
services:
  db:
    image: "postgres:10"
    container_name: "DB"
    ports:
      - "5432:5432"
    volumes:
      - "/mnt/c/Users/mar/src/data:/var/lib/postgresql/data"
    environment:
      POSTGRES_USER: "root"
      POSTGRES_PASSWORD: "root"
      POSTGRES_DB: "dev"

数据库 | chmod:更改“/var/lib/postgresql/data”的权限: 操作不允许 DB 以代码 1 退出

【问题讨论】:

    标签: docker docker-compose windows-subsystem-for-linux


    【解决方案1】:

    我在 Docker 中创建了一个内部卷。

    这样我可以将文件从位置共享到卷。

    【讨论】:

      猜你喜欢
      • 2019-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-24
      • 1970-01-01
      • 1970-01-01
      • 2021-05-25
      • 1970-01-01
      相关资源
      最近更新 更多