Skip to content

Instantly share code, notes, and snippets.

@cubehouse cubehouse/Dockerfile
Created Aug 12, 2018

Embed
What would you like to do?
Build protobuf files for Dart - Docker image
FROM ubuntu
RUN mkdir /proto
WORKDIR /proto
RUN apt update && apt install apt-transport-https gnupg2 curl unzip wget -y
RUN sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
RUN sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
RUN apt update && apt install dart -y
RUN wget https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
RUN unzip protoc-3.6.1-linux-x86_64.zip
RUN /usr/lib/dart/bin/pub global activate protoc_plugin
CMD cp /in/*.proto . && PATH="$PATH":"$HOME/.pub-cache/bin" ./bin/protoc --dart_out=grpc:/out *.proto
@cubehouse

This comment has been minimized.

Copy link
Owner Author

commented Aug 12, 2018

Run:

docker build -t protobuffer . && docker run --rm -v /path/to/proto/files/:/in -v /path/to/output/folder/:/out -t protobuffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.