Public Repository

Last pushed: 8 months ago
Short Description
This is container will continuously rebuild your Go code as you save the files.
Full Description


A development container for your Go projects! This is container will
continuously rebuild your Go code as you save the files. You can also adjust
it from the example project to run any other commands you need to happen with
the bulding of the source.

I try and upload new version with Go releases at

NOTE: This documentation is still in-progress, and will probably take me a
while to complete.

How to Use

This container is designed to be a base for a project specific container, and
so you will need to setup your own Dockerfile with a few additional items.

Setup Project Container

The Dockerfile you create for your project will need add a build script and
attach your code file to the contaier so it can be built.

All files used here are part of an example project here:

Example Dockerfile with explanations

# set the base container to be the correct tag of the godev container
FROM bzvestey/godev:latest

# set the path that the project code will be living in, and the name of our
# built executable.
ENV BUILDPATH $GOPATH/src/godev-example
ENV OUTPUT_NAME godev-exmaple

# set the port to use, and expose it to the outside

# We add our build script ( and its companion for running the program
# ( and make them executable so that we can run them when files change.
RUN chmod +x $TOOLS/
RUN chmod +x $TOOLS/

# Make sure that we have a directory at the build path and them set it to a
# volume so when the project container is run the code can be mounted

# First we run through our build script so that the program can start out
# running, and then we run watcher to run build again once a file changes.
CMD . $TOOLS/ && watcher -dotfiles=false -cmd $TOOLS/ .

The example contains and files you can use as an example.

Run the Example

Run docker-compose up in the example folder and point your browser
at http://localhost:8080 on it is done to view this in action. If you
modify the main.go file, then you will see it rebuild the app and you can
refresh you browser to see the change.

A Thank You

I would like to thank Todd Rafferty for his post on his experiments in the area,
you can find this post here
or the repo with his implementation here.
The decision to make this box was originally inspired by this post and my
interest in playing around with both Docker and Go.



  • Changed to using watcher instead of reflex.
  • Updated the documentation.
  • This now works when ran on a Windows Host
Docker Pull Command