【问题标题】:How to change permissions for Gemfile created with Docker for Windows?如何更改使用 Docker for Windows 创建的 Gemfile 的权限?
【发布时间】:2019-09-20 10:35:58
【问题描述】:

我正在使用 dockerized rails 应用程序,但是每当我对 Gemfile 进行更改时,文件权限都会更改为未知用户,并且无论我是否在容器与否。

我怎样才能使它能够再次操作该文件?

这是我的.docker-copmose.yml

version: '3'

networks:
  backend:

volumes:
  postgres:

services:
  postgres:
    image: postgres
    ports:
      - ${APP:-5432}:5432
    volumes:
      - ./db/dumps:/db/dumps # Mount the directory DB dumps folder
      - postgres:/var/lib/postgresql/data
    networks:
      - backend
    environment:
      POSTGRES_PASSWORD: 3x4mpl3

  web:
    build:
      context: .
      dockerfile: Dockerfile
    command: rails s -b 0.0.0.0 -p 3000
    entrypoint: /app/bin/entrypoint.sh
    volumes:
      - .:/app
    ports:
      - ${APP_WEB_PORT:-3000}:3000
    stdin_open: true
    tty: true
    depends_on:
      - postgres
    networks:
      - backend
    environment:
      DATABASE_URL: postgres://postgres:3x4mpl3@postgres:5432/app_development
      RAILS_ENV: development

【问题讨论】:

    标签: ruby-on-rails ruby docker permissions docker-for-windows


    【解决方案1】:

    您能否尝试从 docker 外部更改文件所有权,然后您可以操作该文件。

    【讨论】:

      猜你喜欢
      • 2018-06-22
      • 1970-01-01
      • 2018-12-23
      • 1970-01-01
      • 2013-10-30
      • 1970-01-01
      • 1970-01-01
      • 2020-10-04
      • 1970-01-01
      相关资源
      最近更新 更多