Skip to content

Commit

Permalink
move gateway into unified docker file (namely#89)
Browse files Browse the repository at this point in the history
* move gateway into unified docker file

* fix gwy-templated dockerfile
  • Loading branch information
mhamrah authored Aug 22, 2018
1 parent ae7b2f1 commit 5b3f7bd
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 30 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_STORE
test.pb.go
test.rb
gen/*
**/gen/*
pb-*

12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,19 @@ ENTRYPOINT [ "prototool" ]
# grpc-cli
FROM protoc-all as grpc-cli


ADD ./cli/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

WORKDIR /run
ENTRYPOINT [ "/entrypoint.sh" ]

# gen-grpc-gateway
FROM protoc-all AS gen-grpc-gateway

COPY gwy/templates /templates
COPY gwy/generate_gateway.sh /usr/local/bin
RUN chmod +x /usr/local/bin/generate_gateway.sh

WORKDIR /defs
ENTRYPOINT [ "generate_gateway.sh" ]

2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GRPC_VERSION=${GRPC_VERSION:-1.14}
BUILD_VERSION=${BUILD_VERSION:-0}
CONTAINER=${DOCKER_REPO}${NAMESPACE}
LATEST=${1:false}
BUILDS=("protoc-all" "protoc" "prototool" "grpc-cli")
BUILDS=("protoc-all" "protoc" "prototool" "grpc-cli" "gen-grpc-gateway")

for build in ${BUILDS[@]}; do
tag=${CONTAINER}/${build}:${GRPC_VERSION}_${BUILD_VERSION}
Expand Down
9 changes: 0 additions & 9 deletions gwy/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions gwy/Makefile

This file was deleted.

7 changes: 5 additions & 2 deletions gwy/templates/Dockerfile.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Template for grpc-gateway

FROM namely/protoc-all AS build
ARG alpine_version=3.8
FROM golang:1.10-alpine$alpine_version AS build

RUN apk add --update --no-cache git
WORKDIR /app
ENV GOPATH=/app

Expand All @@ -15,7 +18,7 @@ WORKDIR /app
# Build the gateway
RUN go build -o grpc_gateway src/pkg/main/main.go

FROM alpine:3.6
FROM alpine:$alpine_version
WORKDIR /app
COPY --from=build /app/grpc_gateway /app/
COPY --from=build /app/config.yaml /app/
Expand Down
Empty file modified gwy/test.sh
100644 → 100755
Empty file.

0 comments on commit 5b3f7bd

Please sign in to comment.