簡體   English   中英

如何在不運行 docker-compose 構建的情況下更新容器代碼?

[英]How to update container code without running docker-compose build?

當我對開發中的任何代碼進行更改時,更改不會反映,直到我再次運行docker-compose up --build

Dockerfile

RUN mkdir /myapp
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
COPY . /myapp

...和docker-compose.yml

server:
    tty: true
    stdin_open: true
    build: .
    command: bash -c "rm -f tmp/pids/server.pid && rake db:create && rake db:migrate &&  bundle exec rails s -p 3000 -b '0.0.0.0'"

    links:
      - db
      - redis

    volumes:

         - ./myapp

這個設置在我的操作系統上運行良好,不知道為什么它在 Windows 上運行不一樣。 本地存儲的文件夾結構C:/users/docker/projects/myapp

任何幫助深表感謝

在這里找到了解決方案: https://github.com/docker/for-win/issues/3385這對我有用。

右鍵單擊目錄單擊屬性單擊安全選項卡單擊“編輯”按鈕。 單擊添加按鈕 在文本框中鍵入“用戶”單擊“檢查名稱”(應該為您自動填寫/更新)單擊確定突出顯示您新添加的組。 10.在“[用戶/組名]的權限”下select完全控制點擊應用點擊“確定”點擊“確定”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM