当Docker中的文件发生更改时重新构建。

huangapple go评论79阅读模式
英文:

Rebuild when files changes on docker

问题

我正在开始使用Docker(在Mac OSX上使用boot2docker)和Golang。

每当我对我的.go文件进行更改时,我希望这些更改能够在Docker镜像中显示出来。

有没有办法做到这一点?或者Docker不适合这样做?

谢谢

英文:

i'm starting to work with docker (with boot2docker on Mac OSX) and golang,

Whenever I make changes on my .go files I want to be visible on the docker image.

Is there anyway to do this? Or docker is not the appropiate thing to do this?

Thanks

答案1

得分: 1

Docker默认情况下不会这样做。我在我的问题和答案这里中描述了几种方法。实现你想要的简单方法是使用一个监视器(如nodemon)来监视你的文件夹,并启动一个脚本(或者更好的是使用fig)来重新创建和运行你的镜像。

英文:

Docker does not do this by default. I described a couple approaches to this in my question & answer here. A simple way to accomplish what you want is to use a watcher (like nodemon) to monitor your folder and kick off a script (or better, use fig) that recreates and runs your images.

huangapple
  • 本文由 发表于 2015年1月27日 01:14:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/28155182.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定