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

Commit 9a916ec

Browse files
committed
Added percona xtradb operator dockerfile.
1 parent da8f3da commit 9a916ec

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM golang:1.17.7 as build
2+
3+
ARG VERSION
4+
ARG TARGETOS
5+
ARG TARGETARCH
6+
ARG TARGETVARIANT=""
7+
ARG GIT_COMMIT
8+
ARG GIT_BRANCH
9+
ARG BUILD_TIME
10+
ARG GO_LDFLAGS
11+
12+
ENV CGO_ENABLED=0 \
13+
GOOS=${TARGETOS} \
14+
GOARCH=${TARGETARCH} \
15+
GOARM=${TARGETVARIANT}
16+
17+
WORKDIR /go/src/github.com/percona/percona-xtradb-cluster-operator
18+
19+
RUN git clone --depth 1 -b ${VERSION} https://github.com/percona/percona-xtradb-cluster-operator .
20+
21+
COPY . .
22+
23+
RUN mkdir -p build/_output/bin \
24+
&& GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=$CGO_ENABLED GO_LDFLAGS=$GO_LDFLAGS \
25+
go build -mod=vendor -ldflags "-w -s -X main.GitCommit=$GIT_COMMIT -X main.GitBranch=$GIT_BRANCH -X main.BuildTime=$BUILD_TIME" \
26+
-o build/_output/bin/percona-xtradb-cluster-operator \
27+
cmd/manager/main.go \
28+
&& cp -r build/_output/bin/percona-xtradb-cluster-operator /usr/local/bin/percona-xtradb-cluster-operator
29+
30+
RUN go get k8s.io/apimachinery/pkg/util/sets \
31+
&& go build -o build/_output/bin/peer-list cmd/peer-list/main.go \
32+
&& cp -r build/_output/bin/peer-list /usr/local/bin/
33+
34+
FROM registry.access.redhat.com/ubi8/ubi-minimal AS ubi8
35+
RUN microdnf update && microdnf clean all
36+
37+
LABEL name="Percona XtraDB Cluster Operator" \
38+
vendor="Percona" \
39+
summary="Percona XtraDB Cluster is an active/active high availability and high scalability open source solution for MySQL clustering" \
40+
description="Percona XtraDB Cluster is a high availability solution that helps enterprises avoid downtime and outages and meet expected customer experience." \
41+
maintainer="Percona Development <[email protected]>"
42+
43+
RUN ls -la
44+
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/LICENSE /licenses/
45+
COPY --from=build /usr/local/bin/percona-xtradb-cluster-operator /usr/local/bin/percona-xtradb-cluster-operator
46+
COPY --from=build /usr/local/bin/peer-list /peer-list
47+
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/pxc-entrypoint.sh /pxc-entrypoint.sh
48+
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/pxc-init-entrypoint.sh /pxc-init-entrypoint.sh
49+
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/unsafe-bootstrap.sh /unsafe-bootstrap.sh
50+
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/pxc-configure-pxc.sh /pxc-configure-pxc.sh
51+
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/liveness-check.sh /liveness-check.sh
52+
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/readiness-check.sh /readiness-check.sh
53+
COPY --from=build /go/src/github.com/percona/percona-xtradb-cluster-operator/build/get-pxc-state /get-pxc-state
54+
55+
USER 2
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# percona-xtradb-cluster-operator
2+
3+
Docker image for Percona's MySQL Operator.

0 commit comments

Comments
 (0)