Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Added percona xtradb operator dockerfile.
Browse files Browse the repository at this point in the history
Signed-off-by: Charles Guertin <[email protected]>
  • Loading branch information
cguertin14 committed Feb 22, 2022
1 parent da8f3da commit 77e0297
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
55 changes: 55 additions & 0 deletions build/percona-xtradb-cluster-operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM golang:1.17.7 as build

ARG VERSION
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT=""
ARG GIT_COMMIT
ARG GIT_BRANCH
ARG BUILD_TIME
ARG GO_LDFLAGS

ENV CGO_ENABLED=0 \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH} \
GOARM=${TARGETVARIANT}

WORKDIR /go/src/github.com/percona/percona-xtradb-cluster-operator

RUN git clone --depth 1 -b ${VERSION} https://github.com/percona/percona-xtradb-cluster-operator .

COPY . .

RUN mkdir -p build/_output/bin \
&& GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=$CGO_ENABLED GO_LDFLAGS=$GO_LDFLAGS \
go build -mod=vendor -ldflags "-w -s -X main.GitCommit=$GIT_COMMIT -X main.GitBranch=$GIT_BRANCH -X main.BuildTime=$BUILD_TIME" \
-o build/_output/bin/percona-xtradb-cluster-operator \
cmd/manager/main.go \
&& cp -r build/_output/bin/percona-xtradb-cluster-operator /usr/local/bin/percona-xtradb-cluster-operator

RUN go get k8s.io/apimachinery/pkg/util/sets \
&& go build -o build/_output/bin/peer-list cmd/peer-list/main.go \
&& cp -r build/_output/bin/peer-list /usr/local/bin/

FROM registry.access.redhat.com/ubi8/ubi-minimal AS ubi8
RUN microdnf update && microdnf clean all

LABEL name="Percona XtraDB Cluster Operator" \
vendor="Percona" \
summary="Percona XtraDB Cluster is an active/active high availability and high scalability open source solution for MySQL clustering" \
description="Percona XtraDB Cluster is a high availability solution that helps enterprises avoid downtime and outages and meet expected customer experience." \
maintainer="Percona Development <[email protected]>"

RUN ls -la
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/LICENSE /licenses/
COPY --from=build /usr/local/bin/percona-xtradb-cluster-operator /usr/local/bin/percona-xtradb-cluster-operator
COPY --from=build /usr/local/bin/peer-list /peer-list
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/pxc-entrypoint.sh /pxc-entrypoint.sh
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/pxc-init-entrypoint.sh /pxc-init-entrypoint.sh
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/unsafe-bootstrap.sh /unsafe-bootstrap.sh
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/pxc-configure-pxc.sh /pxc-configure-pxc.sh
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/liveness-check.sh /liveness-check.sh
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/readiness-check.sh /readiness-check.sh
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/get-pxc-state /get-pxc-state

USER 2
3 changes: 3 additions & 0 deletions build/percona-xtradb-cluster-operator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# percona-xtradb-cluster-operator

Docker image for Percona's MySQL Operator.

0 comments on commit 77e0297

Please sign in to comment.