Skip to content

An example project to create a Docker image for a Go application containing a static REST service.

License

Notifications You must be signed in to change notification settings

larmic/rest-json-with-go-in-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON static rest example with Go and Docker

Build Status License

An example project to create a Docker image for a Go application containing a static REST service.

Requirements

  • Docker
  • Go 1.15.x (if you want to build it without using docker builder)

Build it

$ make build                        # build native app to ./build folder
            
$ make docker-build                 # build local docker image
$ make docker-push                  # push local docker image to hub.docker.com
$ make docker-all                   # build and push docker image to hub.docker.com
$ make IMAGE_TAG="0.0.1" docker-all # build and push docker image with specific version

$ make clean                        # clean up go and build folder

Run it native

$ make run                                  # start native app 
$ curl http://localhost:8080/api/channels   # call rest service
$ ctrl+c                                    # stop native app

Run it using docker

$ make docker-run                           # start docker image 
$ curl http://localhost:8080/api/channels   # call rest service
$ make docker-stop                          # stop and remove docker app

About

An example project to create a Docker image for a Go application containing a static REST service.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages