From 756ca6ca58940d3e57093b4d3b5f62989b6a2f5e Mon Sep 17 00:00:00 2001
From: Hamidreza Asaadi
Date: Sun, 18 Nov 2018 16:48:21 +0000
Subject: [PATCH] reverted productcatalog services (not using dbg for now)
---
README.md | 4 ++++
src/productcatalogservice/Dockerfile | 21 +++++----------------
2 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/README.md b/README.md
index 2094a6b..ba33eb4 100644
--- a/README.md
+++ b/README.md
@@ -131,6 +131,10 @@ Find **Protocol Buffers Descriptions** at the [`./pb` directory](./pb).
- applies the `./kubernetes-manifests` deploying the application to
Kubernetes.
+ **Troubleshooting:** If you get "No space left on device" error on Google Cloud Shell,
+ you can build the images on Google Cloud Build:
+ [Enable the Cloud Build API](https://console.cloud.google.com/flows/enableapi?apiid=cloudbuild.googleapis.com), then run `skaffold run -p gcb` instead.
+
7. Find the IP address of your application, then visit the application on your
browser to confirm installation.
diff --git a/src/productcatalogservice/Dockerfile b/src/productcatalogservice/Dockerfile
index 8905a82..352a6f0 100644
--- a/src/productcatalogservice/Dockerfile
+++ b/src/productcatalogservice/Dockerfile
@@ -1,5 +1,5 @@
FROM golang:1.10-alpine AS builder
-RUN apk add --no-cache ca-certificates git gcc g++ && \
+RUN apk add --no-cache ca-certificates git && \
wget -qO/go/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && \
chmod +x /go/bin/dep
@@ -11,26 +11,15 @@ COPY Gopkg.* ./
RUN dep ensure --vendor-only -v
COPY . .
-RUN go build -gcflags=all='-N -l' -o /productcatalogservice .
+RUN go build -o /productcatalogservice .
FROM alpine AS release
-RUN apk add --no-cache ca-certificates \
- libc6-compat
-
+RUN apk add --no-cache ca-certificates
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe
-
WORKDIR /productcatalogservice
-
-RUN wget -O go-cloud-debug https://storage.googleapis.com/cloud-debugger/compute-go/go-cloud-debug \
- && chmod 0755 go-cloud-debug
-
COPY --from=builder /productcatalogservice ./server
-COPY products.json source-context.json* ./
-
+COPY products.json .
EXPOSE 3550
-ENTRYPOINT ["./go-cloud-debug", "-sourcecontext=source-context.json", \
- "-appmodule=productcatalogservice", "-appversion=1.0.0" , \
- "--", "/productcatalogservice/server"]
-
+ENTRYPOINT ["/productcatalogservice/server"]