Coder Social home page Coder Social logo

docker-go-kit-example's Introduction

docker-go-kit-example

  1. Clone
$ git clone https://github.com/myhilmyhill/docker-go-kit-example.git
$ cd docker-go-kit-example
  1. Put an example
$ curl -o main.go https://raw.githubusercontent.com/go-kit/kit/master/examples/stringsvc1/main.go
  1. Build
$ docker build -t go-kit-example .
  1. Run
$ docker run -d --rm -p 8080:8080/tcp --name example go-kit-example
  1. Use
$ curl -X POST -d "{""s"":""hello, world""}" localhost:8080/uppercase
{"v":"HELLO, WORLD"}
$ curl -X POST -d "{""s"":""hello, world""}" localhost:8080/count
{"v":12}
  1. Stop
$ docker stop example
  1. Build and run another example (using cache on the builder layer)
$ rm main.go
$ curl https://github.com/go-kit/kit/raw/master/examples/stringsvc3/instrumenting.go -o instrumenting.go
$ curl https://github.com/go-kit/kit/raw/master/examples/stringsvc3/logging.go -o logging.go
$ curl https://github.com/go-kit/kit/raw/master/examples/stringsvc3/main.go -o main.go
$ curl https://github.com/go-kit/kit/raw/master/examples/stringsvc3/proxying.go -o proxying.go
$ curl https://github.com/go-kit/kit/raw/master/examples/stringsvc3/service.go -o service.go
$ curl https://github.com/go-kit/kit/raw/master/examples/stringsvc3/transport.go -o transport.go
$ docker build -t go-kit-example2 .
$ docker run -d --rm -p 8080:8080/tcp --name example2 go-kit-example2
$ curl -X POST -d "{""s"":""hello, world""}" localhost:8080/uppercase
{"v":"HELLO, WORLD"}
$ curl -X POST -d "{""s"":""hello, world""}" localhost:8080/count
{"v":12}
$ docker stop example2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.