ARG BASE_BRANCH
FROM quay.io/submariner/shipyard-dapper-base:release-0.9

ENV DAPPER_ENV="REPO MAKEFLAGS TAG QUAY_USERNAME QUAY_PASSWORD GITHUB_REF CLUSTERS_ARGS DEPLOY_ARGS CLEANUP_ARGS IMAGES_ARGS RELEASE_ARGS FOCUS SKIP PLUGIN" \
    DAPPER_SOURCE=/go/src/github.com/submariner-io/submariner DAPPER_DOCKER_SOCKET=true
ENV DAPPER_OUTPUT=${DAPPER_SOURCE}/output

ENV PROTOC_VERSION=3.15.5

# alternative: dnf install -y --nodocs --setopt=install_weak_deps=False golang-google-protobuf protobuf-compiler && dnf -y clean all
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.5/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \
    unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local && \
    rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip && \
    GO111MODULE=off go get google.golang.org/protobuf/cmd/protoc-gen-go

WORKDIR ${DAPPER_SOURCE}

ENTRYPOINT ["/opt/shipyard/scripts/entry"]
