Skip to content

Commit

Permalink
[examples/demo] fix demo could not stat up (#16169)
Browse files Browse the repository at this point in the history
* fix demo could not stat up

Signed-off-by: Jared Tan <[email protected]>

* remove unnecessary GOOS=linux

Signed-off-by: Jared Tan <[email protected]>

Signed-off-by: Jared Tan <[email protected]>
  • Loading branch information
JaredTan95 authored Nov 16, 2022
1 parent 3c2d780 commit d9b5dcc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
10 changes: 5 additions & 5 deletions examples/demo/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.18 as build
COPY . /usr/src/client/
WORKDIR /usr/src/client/
WORKDIR /app/
COPY . .
RUN go env -w GOPROXY=direct
RUN go install ./main.go
RUN CGO_ENABLED=0 go build -o main main.go
FROM alpine:3.15
COPY --from=build /go/bin/main /go/bin/main
CMD ["/go/bin/main"]
COPY --from=build /app/main /app/main
CMD ["/app/main"]
6 changes: 6 additions & 0 deletions examples/demo/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
# Jaeger
jaeger-all-in-one:
image: jaegertracing/all-in-one:latest
restart: always
ports:
- "16686:16686"
- "14268"
Expand All @@ -12,12 +13,14 @@ services:
# Zipkin
zipkin-all-in-one:
image: openzipkin/zipkin:latest
restart: always
ports:
- "9411:9411"

# Collector
otel-collector:
image: ${OTELCOL_IMG}
restart: always
command: ["--config=/etc/otel-collector-config.yaml", "${OTELCOL_ARGS}"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
Expand All @@ -36,6 +39,7 @@ services:
build:
dockerfile: Dockerfile
context: ./client
restart: always
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=otel-collector:4317
- DEMO_SERVER_ENDPOINT=http://demo-server:7080/hello
Expand All @@ -46,6 +50,7 @@ services:
build:
dockerfile: Dockerfile
context: ./server
restart: always
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=otel-collector:4317
ports:
Expand All @@ -56,6 +61,7 @@ services:
prometheus:
container_name: prometheus
image: prom/prometheus:latest
restart: always
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yml
ports:
Expand Down
10 changes: 5 additions & 5 deletions examples/demo/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.18 as build
COPY . /usr/src/server/
WORKDIR /usr/src/server/
WORKDIR /app/
COPY . .
RUN go env -w GOPROXY=direct
RUN go install ./main.go
RUN CGO_ENABLED=0 go build -o main main.go
FROM alpine:3.15
COPY --from=build /go/bin/main /go/bin/main
CMD ["/go/bin/main"]
COPY --from=build /app/main /app/main
CMD ["/app/main"]

0 comments on commit d9b5dcc

Please sign in to comment.