码头工程师编写的代码不会显示任何更改 [英] docker-compose not showing any changes to code

查看:249
本文介绍了码头工程师编写的代码不会显示任何更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个使用 docker-compise up 来启动和运行的项目。我对Docker-compose不太熟悉,我在文档中找不到答案。根据文档, up 命令从docker文件重建容器,但这似乎不会发生。

I am working on a project that uses docker-compose up to start up and run. I am not very familiar with docker-compose and I couldn't really find an answer in the docs. According to the docs the up command rebuilds the container from the docker file, however this does not seem to happen.

当我尝试添加 print 命令调试没有任何反应。该程序已经抛出了一些打印命令,我尝试更改这些命令,并且它们总是打印相同的。我必须添加一些东西到 up 命令使容器重建?

When I try to add print commands for debugging nothing happens. The program already throws a few print commands and I tried changing those to be sure, and they always print the same. Do I have to add something to the up command to make the container rebuild?

docker-compose / yml:

docker-compose/yml:

dockbrato:
  build: .
  volumes:
    - "/sys:/sys"
    - "/var/run/docker.sock:/var/run/docker.sock"


推荐答案

据我所知, docker-compose up 只生成不存在的图像;它不会重建其源已更改的图像。如果要重建图像,请在 docker-compose up 之前运行 docker-compose build

这篇关于码头工程师编写的代码不会显示任何更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆