Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mefellows/demo-docker-go-api
Demo/Test Application: Golang Microservice deployed to a minimal Docker container
https://github.com/mefellows/demo-docker-go-api
Last synced: about 2 months ago
JSON representation
Demo/Test Application: Golang Microservice deployed to a minimal Docker container
- Host: GitHub
- URL: https://github.com/mefellows/demo-docker-go-api
- Owner: mefellows
- License: mit
- Created: 2015-02-18T12:18:30.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-18T12:27:50.000Z (almost 10 years ago)
- Last Synced: 2024-10-11T22:55:15.919Z (2 months ago)
- Language: Go
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golang Docker Microservice
## Getting Started
* Install Docker and Boot2Docker (`brew install docker boot2docker`)
* Install the Go cross-compiler [Gox](https://github.com/mitchellh/gox)```
go get github.com/mitchellh/gox
gox -build-toolchain
```
## Build and Run application in Docker```
time gox -osarch="linux/amd64" -output="micro-go" && docker build -t mfellows/micro-go . && docker run --name api --rm -i -t -p 8000:8000 mfellows/micro-go
```This will build a binary for 64bit linux with the name `micro-go`, create a Docker image and then run the image exposing port `8000`.
The API is now running on port 8000, `curl` until your heart is content:
```
curl $(boot2docker ip):8000/hello/peeps
```