0

Normally, when you run a Go app using Go-Appengine's goapp serve command, file changes are detected and initiate a re-build.

INFO     2015-01-11 ... Detected file changes: ...

I'm currently experimenting with running Go-Appengine inside a docker container, and while the server starts appropriately, file changes do not initiate a re-build. How do I make this happen?

From my personal experience, Django projects running inside and outside docker containers behave the same way when file changes are detected.

Quentin Donnellan
  • 2,687
  • 1
  • 18
  • 24

1 Answers1

1

I think the problem here is that the files don't change inside the docker-container, only on the host-filesystem. Your source-directory is added in the Dockerfile (when the container-image is built). If you change the files later, the container is not automatically rebuilt.

To solve this issue (for development-purposes) you could mount the source-directory from your host-system into the docker-container. with this trick, source-changes are automatically added to the container.

To to this, add

volumes:
  - .:/go/src
Johannes Reuter
  • 3,501
  • 19
  • 20
  • Oh dang, I must have totally missed that "volumes" served this purpose, this is hugely helpful, thanks (going to try it now...) – Quentin Donnellan Jan 12 '15 at 13:25
  • Blarg... no luck yet, I think I have some "docker" education issues to solve first before I get to the Go problems here (if there indeed are any). I'm bookmarking this and will definitely accept once I can confirm my stupidity is not the blocker! – Quentin Donnellan Jan 12 '15 at 15:18