-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd21a9b
commit f5a1758
Showing
3 changed files
with
61 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,66 @@ | ||
# Copyright 2022 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
################################################################################ | ||
# Image of a machine with installed swagger-combine and starport. | ||
################################################################################ | ||
|
||
FROM node | ||
|
||
# Install golang | ||
ARG GO_VERSION | ||
ENV GO_VERSION=${GO_VERSION:-1.17.2} | ||
ENV BASH_ENV=/etc/bashrc | ||
ENV PATH="${PATH}:/usr/local/go/bin" | ||
RUN curl -L https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz -o /tmp/go.tar.gz \ | ||
&& rm -rf /usr/local/go \ | ||
&& tar -C /usr/local -xzf /tmp/go.tar.gz \ | ||
&& go version \ | ||
&& rm -f /tmp/go.tar.gz | ||
|
||
# Install protoc | ||
ARG PROTOC_VERSION | ||
ENV PROTOC_VERSION=${PROTOC_VERSION:-3.19.4} | ||
RUN PROTOC_ZIP=protoc-${PROTOC_VERSION}-linux-x86_64.zip \ | ||
&& curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP} \ | ||
&& unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \ | ||
&& unzip -o $PROTOC_ZIP -d /usr/local 'include/*' \ | ||
&& rm -f $PROTOC_ZIP | ||
|
||
# Install grpc-gateway tools | ||
ENV PROTOC_GEN_GRPC_GATEWAY_VERSION=v2.8.0 | ||
ENV PROTOC_GEN_OPENAPIV2_VERSION=v2.8.0 | ||
ENV PROTOC_GEN_SWAGGER_VERSION=v1.16.0 | ||
FROM alpine:3.15 as builder | ||
|
||
RUN go install \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${PROTOC_GEN_GRPC_GATEWAY_VERSION} \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${PROTOC_GEN_OPENAPIV2_VERSION} | ||
|
||
RUN go install \ | ||
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@${PROTOC_GEN_SWAGGER_VERSION} | ||
ARG STARPORT_VERSION | ||
|
||
RUN npm install -g swagger-combine | ||
ENV STARPORT_VERSION=${STARPORT_VERSION:-v0.19.3} | ||
#ENV STARPORT_VERSION=${STARPORT_VERSION:-dev} | ||
|
||
RUN apk --no-cache add \ | ||
make=4.3-r0 \ | ||
go=1.17.4-r0 \ | ||
git=2.34.1-r0 \ | ||
bash=5.1.16-r0 | ||
|
||
# Install starport | ||
ARG STARPORT_VERSION | ||
ENV STARPORT_VERSION=${STARPORT_VERSION:-0.19.3} | ||
#ENV STARPORT_VERSION=${STARPORT_VERSION:-dev} | ||
WORKDIR /tmp | ||
RUN git clone https://github.com/tendermint/starport.git \ | ||
&& if [ "$STARPORT_VERSION" != "dev" ]; then \ | ||
git -C /tmp/starport checkout -b ${STARPORT_VERSION:-v0.19.3} tags/${STARPORT_VERSION:-v0.19.3}; \ | ||
fi \ | ||
&& make -C /tmp/starport build | ||
|
||
RUN if [ "$STARPORT_VERSION" = "dev" ]; then \ | ||
curl -L https://github.com/tendermint/starport/archive/refs/heads/develop.zip -o /tmp/starport.zip && \ | ||
cd /tmp \ | ||
&& unzip starport.zip \ | ||
&& cd starport-develop \ | ||
&& make build \ | ||
&& cp ./dist/starport /usr/local/bin; \ | ||
else \ | ||
curl https://get.starport.network/starport@v${STARPORT_VERSION}! -o /tmp/startport \ | ||
&& bash /tmp/startport \ | ||
&& rm /tmp/startport; \ | ||
fi | ||
FROM alpine:3.15 | ||
|
||
ENV PROTOC_GEN_GRPC_GATEWAY_VERSION=v2.8.0 | ||
ENV PROTOC_GEN_OPENAPIV2_VERSION=v2.8.0 | ||
ENV PROTOC_GEN_SWAGGER_VERSION=v1.16.0 | ||
ENV PATH="/root/go/bin:${PATH}" | ||
ENV PATH="${PATH}:/usr/local/bin" | ||
|
||
WORKDIR /dcl | ||
COPY --from=builder /tmp/starport/dist/starport /usr/local/bin/starport | ||
|
||
RUN apk --no-cache add \ | ||
bash=5.1.16-r0 \ | ||
git=2.34.1-r0 \ | ||
go=1.17.4-r0 \ | ||
protobuf=3.18.1-r1 \ | ||
protobuf-dev=3.18.1-r1 \ | ||
npm=8.1.3-r0 \ | ||
&& npm install -g swagger-combine@1.4.0 | ||
|
||
# Install grpc-gateway tools | ||
|
||
RUN go install \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${PROTOC_GEN_GRPC_GATEWAY_VERSION} \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${PROTOC_GEN_OPENAPIV2_VERSION} \ | ||
&& go install \ | ||
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@${PROTOC_GEN_SWAGGER_VERSION} | ||
|
||
WORKDIR /dcl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters