Skip to content

Commit

Permalink
Add Dockerfile for hotrod example app (#694)
Browse files Browse the repository at this point in the history
* Binding all interfaces on hotrod

Signed-off-by: Guilherme Baufaker Rêgo <[email protected]>

* Hotrod Containerized on Docker

Signed-off-by: Guilherme Baufaker Rêgo <[email protected]>

* Moving HotRod Containerized to Hotrod folder

and some minor adjustments on Dockerfile

Signed-off-by: Guilherme Baufaker Rêgo <[email protected]>

* Copy only Hotrod binary to Dockerfile

- exposing more ports on Dockerfile
and copy only binary to Dockerfile

Signed-off-by: Guilherme Baufaker Rêgo <[email protected]>
  • Loading branch information
Guilherme Baufaker Rêgo authored and pavolloffay committed Feb 19, 2018
1 parent 9fe8cc8 commit a631623
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions examples/hotrod/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch
EXPOSE 8080 8081 8082 8083
COPY hotrod-linux /
CMD ["./hotrod-linux", "all"]
2 changes: 1 addition & 1 deletion examples/hotrod/cmd/customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ var (
func init() {
RootCmd.AddCommand(customerCmd)

customerCmd.Flags().StringVarP(&customerOptions.serverInterface, "bind", "", "127.0.0.1", "interface to which the Customer server will bind")
customerCmd.Flags().StringVarP(&customerOptions.serverInterface, "bind", "", "0.0.0.0", "interface to which the Customer server will bind")
customerCmd.Flags().IntVarP(&customerOptions.serverPort, "port", "p", 8081, "port on which the Customer server will listen")
}
2 changes: 1 addition & 1 deletion examples/hotrod/cmd/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ var (
func init() {
RootCmd.AddCommand(driverCmd)

driverCmd.Flags().StringVarP(&driverOptions.serverInterface, "bind", "", "127.0.0.1", "interface to which the driver server will bind")
driverCmd.Flags().StringVarP(&driverOptions.serverInterface, "bind", "", "0.0.0.0", "interface to which the driver server will bind")
driverCmd.Flags().IntVarP(&driverOptions.serverPort, "port", "p", 8082, "port on which the driver server will listen")
}
2 changes: 1 addition & 1 deletion examples/hotrod/cmd/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ var (
func init() {
RootCmd.AddCommand(frontendCmd)

frontendCmd.Flags().StringVarP(&frontendOptions.serverInterface, "bind", "", "127.0.0.1", "interface to which the frontend server will bind")
frontendCmd.Flags().StringVarP(&frontendOptions.serverInterface, "bind", "", "0.0.0.0", "interface to which the frontend server will bind")
frontendCmd.Flags().IntVarP(&frontendOptions.serverPort, "port", "p", 8080, "port on which the frontend server will listen")
}
2 changes: 1 addition & 1 deletion examples/hotrod/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Execute() {

func init() {
RootCmd.PersistentFlags().StringVarP(&metricsBackend, "metrics", "m", "expvar", "Metrics backend (expvar|prometheus)")
RootCmd.PersistentFlags().StringVarP(&jAgentHostPort, "jaeger-agent.host-port", "a", "localhost:6831", "String representing jaeger-agent host:port")
RootCmd.PersistentFlags().StringVarP(&jAgentHostPort, "jaeger-agent.host-port", "a", "0.0.0.0:6831", "String representing jaeger-agent host:port")
rand.Seed(int64(time.Now().Nanosecond()))
logger, _ = zap.NewDevelopment()
cobra.OnInitialize(initMetrics)
Expand Down
2 changes: 1 addition & 1 deletion examples/hotrod/cmd/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ var (
func init() {
RootCmd.AddCommand(routeCmd)

routeCmd.Flags().StringVarP(&routeOptions.serverInterface, "bind", "", "127.0.0.1", "interface to which the Route server will bind")
routeCmd.Flags().StringVarP(&routeOptions.serverInterface, "bind", "", "0.0.0.0", "interface to which the Route server will bind")
routeCmd.Flags().IntVarP(&routeOptions.serverPort, "port", "p", 8083, "port on which the Route server will listen")
}
5 changes: 5 additions & 0 deletions examples/hotrod/create-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cd $GOPATH/src/github.com/jaegertracing/jaeger
make install
cd $GOPATH/src/github.com/jaegertracing/jaeger/examples/hotrod
CGO_ENABLED=0 GOOS=linux installsuffix=cgo go build -o hotrod-linux main.go
docker build -t jaegertracing/hotrod -f Dockerfile .

0 comments on commit a631623

Please sign in to comment.