Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,10 @@ go:
- 1.12.x

env:
- DEP_VERSION="0.5.3"
- GO111MODULE="on"

before_install:
# Download the binary to bin folder in $GOPATH
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
# Make the binary executable
- chmod +x $GOPATH/bin/dep

install:
- dep ensure
- go mod download

go_import_path: github.com/GoogleCloudPlatform/spark-on-k8s-operator

Expand Down
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ ARG SPARK_IMAGE=gcr.io/spark-operator/spark:v2.4.0
FROM golang:1.12.5-alpine as builder
ARG DEP_VERSION="0.5.3"
RUN apk add --no-cache bash git
ADD https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 /usr/bin/dep
RUN chmod +x /usr/bin/dep

WORKDIR ${GOPATH}/src/github.com/GoogleCloudPlatform/spark-on-k8s-operator
COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure -vendor-only
WORKDIR /tmp/github.com/GoogleCloudPlatform/spark-on-k8s-operator
COPY go.mod go.sum ./
RUN go mod download

FROM builder as operator_builder
WORKDIR /tmp/github.com/GoogleCloudPlatform/spark-on-k8s-operator
COPY . ./
ENV GO111MODULE=on
RUN go generate && CGO_ENABLED=0 GOOS=linux go build -o /usr/bin/spark-operator

FROM ${SPARK_IMAGE}
COPY --from=builder /usr/bin/spark-operator /usr/bin/
COPY --from=operator_builder /usr/bin/spark-operator /usr/bin/
RUN apk add --no-cache openssl curl tini
COPY hack/gencerts.sh /usr/bin/

COPY entrypoint.sh /usr/bin/
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
15 changes: 8 additions & 7 deletions Dockerfile.rh
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ ARG SPARK_IMAGE=gcr.io/spark-operator/spark:v2.4.0
FROM golang:1.12.5-alpine as builder
ARG DEP_VERSION="0.5.3"
RUN apk add --no-cache bash git
ADD https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 /usr/bin/dep
RUN chmod +x /usr/bin/dep
WORKDIR /tmp/github.com/GoogleCloudPlatform/spark-on-k8s-operator
COPY go.mod go.sum ./
RUN go mod download

WORKDIR ${GOPATH}/src/github.com/GoogleCloudPlatform/spark-on-k8s-operator
COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure -vendor-only
FROM builder as operator_builder
WORKDIR /tmp/github.com/GoogleCloudPlatform/spark-on-k8s-operator
COPY . ./
ENV GO111MODULE=on
RUN go generate && CGO_ENABLED=0 GOOS=linux go build -o /usr/bin/spark-operator

FROM ${SPARK_IMAGE}
COPY --from=builder /usr/bin/spark-operator /usr/bin/
COPY --from=operator_builder /usr/bin/spark-operator /usr/bin/
USER root

# Comment out the following three lines if you do not have a RedHat subscription.
Expand All @@ -48,4 +49,4 @@ RUN chmod -R u+x /tmp
COPY hack/gencerts.sh /usr/bin/
COPY entrypoint.sh /usr/bin/
USER 185
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
Loading