Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derberg/docker-golang-hot-reload
Develop with Go in a Docker container with automated rebuild on file changes
https://github.com/derberg/docker-golang-hot-reload
container development docker fresh go golang hot-reload kubernetes minikube
Last synced: 11 days ago
JSON representation
Develop with Go in a Docker container with automated rebuild on file changes
- Host: GitHub
- URL: https://github.com/derberg/docker-golang-hot-reload
- Owner: derberg
- License: mit
- Created: 2018-03-30T19:10:10.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-05T09:38:00.000Z (about 6 years ago)
- Last Synced: 2025-01-29T04:54:25.454Z (15 days ago)
- Topics: container, development, docker, fresh, go, golang, hot-reload, kubernetes, minikube
- Language: Dockerfile
- Homepage: https://derberg.github.io/docker-golang-hot-reload/
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Docker Pulls](https://img.shields.io/docker/pulls/derberg/docker-golang-hot-reload.svg)
![Docker Stars](https://img.shields.io/docker/stars/derberg/docker-golang-hot-reload.svg)# Docker Golang Hot-Reload
This repo contains `Dockerfile` for image containing Go v1.9.2 and [Fresh](https://github.com/pilu/fresh) reloader. It is relased on [Docker Hub](https://hub.docker.com/r/derberg/docker-golang-hot-reload/)
## Usage
Below example assumes you run the image in your project's location
```
#my-project is your project's location
PROJECT=/go/src/{my-project}#below container run does the following
#rm - makes sure that once you stop the container it is immediately removed
#v - mounts your current directory into a container under proper location needed for Go
#w - sets working directory inside container to the one you mounted in your project. This is necessary, Go magic
#p - exposes port 3000 from inside to 3000 outside
docker run --rm \
-v $(PWD):$PROJECT \
-w $PROJECT \
-p 3000:3000 \
derberg/docker-golang-hot-reload:1.0
```## Vendor directory case
Fresh is awesome, but every tool has some limits. For Fresh it is `vendor` directory with your dependencies. You need to exclude it by putting below config file (`runner.conf`) in the root of your project:
```
root: .
tmp_path: ./tmp
build_name: runner-build
build_log: runner-build-errors.log
valid_ext: .go
no_rebuild_ext: .tpl, .tmpl, .html
ignored: vendor
build_delay: 600
colors: 1
log_color_main: cyan
log_color_build: yellow
log_color_runner: green
log_color_watcher: magenta
log_color_app:
```## Image publishing
```
docker login
docker build -t docker-golang-hot-reload .
docker tag docker-golang-hot-reload derberg/docker-golang-hot-reload:1.0
docker push derberg/docker-golang-hot-reload:1.0
```