Split up python/swift dockerfiles

Doing this as I don't need to have both in a single container (not needed)
This commit is contained in:
Michael Pivato
2021-02-02 13:08:29 +00:00
parent 983a1460d8
commit d0af2e21ba
5 changed files with 87 additions and 35 deletions

34
swift_web/Dockerfile Normal file
View File

@@ -0,0 +1,34 @@
FROM vato.ddns.net:8083/swift AS SWIFT_BUILDER
ARG GRPC_SWIFT_VERSION=1.0.0-alpha.21
RUN git clone -b ${GRPC_SWIFT_VERSION} https://github.com/grpc/grpc-swift.git grpc-swift
COPY ./build_grpc_swift_plugins_static.sh grpc-swift/
RUN cd grpc-swift && chmod +x build_grpc_swift_plugins_static.sh && ./build_grpc_swift_plugins_static.sh && rm -rf .build
FROM vato.ddns.net:8083/alpine
ARG ARCH=x86_64
ARG PROTOC_VERSION=3.14.0
ARG GRPC_WEB_VERSION=1.2.1
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk && \
apk add glibc-2.32-r0.apk
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${ARCH}.zip -O protoc.zip && \
unzip protoc.zip -d /usr/ && \
chmod +x /usr/bin/protoc && \
rm protoc.zip /usr/readme.txt
RUN wget https://github.com/grpc/grpc-web/releases/download/${GRPC_WEB_VERSION}/protoc-gen-grpc-web-${GRPC_WEB_VERSION}-linux-${ARCH} && \
wget https://github.com/grpc/grpc-web/releases/download/${GRPC_WEB_VERSION}/protoc-gen-grpc-web-${GRPC_WEB_VERSION}-linux-${ARCH}.sha256 && \
cat protoc-gen-grpc-web-*.sha256 | sha256sum -c
RUN rm protoc-gen-grpc-web-*.sha256 && \
mv protoc-gen-grpc-web-* /usr/bin/protoc-gen-grpc-web && \
chmod +x /usr/bin/protoc-gen-grpc-web
COPY --from=SWIFT_BUILDER /grpc-swift/protoc-gen-* /usr/bin/

View File

@@ -0,0 +1,10 @@
SWIFT_BUILD_PATH=./.build
PROTOC_GEN_SWIFT=${SWIFT_BUILD_PATH}/release/protoc-gen-swift
PROTOC_GEN_GRPC_SWIFT=${SWIFT_BUILD_PATH}/release/protoc-gen-grpc-swift
MAIN_SCRIPT="swift build --configuration=release --build-path=${SWIFT_BUILD_PATH} -Xswiftc -static-executable"
${MAIN_SCRIPT} --product protoc-gen-swift
${MAIN_SCRIPT} --product protoc-gen-grpc-swift
cp ${SWIFT_BUILD_PATH}/release/protoc-gen-swift .
cp ${SWIFT_BUILD_PATH}/release/protoc-gen-grpc-swift .