Skip to content

Instantly share code, notes, and snippets.

@sxwebdev
Forked from rizo/Dockerfile
Created May 24, 2020 23:15
Show Gist options
  • Select an option

  • Save sxwebdev/d67dd3ff7a6d71dd08ba50498fd96a3a to your computer and use it in GitHub Desktop.

Select an option

Save sxwebdev/d67dd3ff7a6d71dd08ba50498fd96a3a to your computer and use it in GitHub Desktop.

Revisions

  1. @rizo rizo revised this gist Aug 9, 2017. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,6 @@
    #
    # This image builds protocol buffers library from source with Go generation
    # support. The builder and runner images are produced.
    #

    # Builder Image
    # -------------
  2. @rizo rizo revised this gist Aug 9, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -34,8 +34,10 @@ RUN cp /go/bin/protoc-gen-go /export/bin/
    RUN cp /usr/lib/libstdc++* /export/lib/
    RUN cp /usr/lib/libgcc_s* /export/lib/


    # Runner Image
    # ------------

    FROM alpine:3.6
    RUN apk --no-cache add ca-certificates
    RUN mkdir /import
  3. @rizo rizo revised this gist Aug 9, 2017. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -11,8 +11,7 @@
    FROM golang:1.8.3-alpine3.6 as builder

    # System setup
    RUN apk update
    RUN apk add git curl build-base autoconf automake libtool
    RUN apk update && apk add git curl build-base autoconf automake libtool

    # Install protoc
    ENV PROTOBUF_URL https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
  4. @rizo rizo created this gist Aug 9, 2017.
    45 changes: 45 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    # Protobuf Builder
    # ================
    #
    # This image builds protocol buffers library from source with Go generation
    # support. The builder and runner images are produced.
    #

    # Builder Image
    # -------------

    FROM golang:1.8.3-alpine3.6 as builder

    # System setup
    RUN apk update
    RUN apk add git curl build-base autoconf automake libtool

    # Install protoc
    ENV PROTOBUF_URL https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
    RUN curl -L -o /tmp/protobuf.tar.gz $PROTOBUF_URL
    WORKDIR /tmp/
    RUN tar xvzf protobuf.tar.gz
    WORKDIR /tmp/protobuf-3.3.0
    RUN mkdir /export
    RUN ./autogen.sh && \
    ./configure --prefix=/export && \
    make -j 3 && \
    make check && \
    make install

    # Install protoc-gen-go
    RUN go get github.com/golang/protobuf/protoc-gen-go
    RUN cp /go/bin/protoc-gen-go /export/bin/

    # Export dependencies
    RUN cp /usr/lib/libstdc++* /export/lib/
    RUN cp /usr/lib/libgcc_s* /export/lib/

    # Runner Image
    # ------------
    FROM alpine:3.6
    RUN apk --no-cache add ca-certificates
    RUN mkdir /import
    WORKDIR /import
    COPY --from=builder /export /usr
    ENTRYPOINT ["protoc"]