Skip to content
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
6 changes: 3 additions & 3 deletions images/mgr-operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ ARG BASE_IMAGE_REPOSITORY=ghcr.io/ksmartdata/community-operator
FROM alpine:3.22.2 AS downloader

ARG MGR_OPERATOR_REF=package
ARG MYSQL_OPERATOR_EXTRA_IMAGE_REF=extra_image
ARG MYSQL_OPERATOR_EXTRA_IMAGE_REF=v0.8.0
WORKDIR /tmp
RUN wget -q "https://github.com/ksmartdata/mgr-operator/archive/${MGR_OPERATOR_REF}.zip" -O mgr-operator.zip && \
unzip -q mgr-operator.zip && \
mv mgr-operator-* mgr-operator-src && \
wget -q "https://github.com/ksmartdata/mysql-operator/archive/${MYSQL_OPERATOR_EXTRA_IMAGE_REF}.zip" -O extra_image.zip && \
unzip -q extra_image.zip && \
wget -q "https://github.com/ksmartdata/mysql-operator/archive/${MYSQL_OPERATOR_EXTRA_IMAGE_REF}.zip" -O mysql-operator.zip && \
unzip -q mysql-operator.zip && \
mv mysql-operator-* mysql-operator-src

FROM golang:1.24.13-alpine AS builder
Expand Down
14 changes: 10 additions & 4 deletions images/mysql-operator-sidecar-5.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM --platform=$TARGETPLATFORM golang:1.21.11 as builder
# keep the Go version current: the stdlib compiled into the sidecar binary
# is what the trivy CRITICAL gate scans (see the 8.4 image)
FROM --platform=$TARGETPLATFORM golang:1.26-bookworm as builder

Check warning on line 3 in images/mysql-operator-sidecar-5.7/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-5.7)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/

Check warning on line 3 in images/mysql-operator-sidecar-5.7/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-5.7)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 3 in images/mysql-operator-sidecar-5.7/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-5.7)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/

Check warning on line 3 in images/mysql-operator-sidecar-5.7/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-5.7)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

USER root

Expand All @@ -8,18 +10,22 @@
ENV GOPROXY=https://goproxy.cn
ENV GOPATH=/build

# pinned mysql-operator ref (tag or commit - repo policy forbids pulling
# from branch heads); bump via build-args when cutting a new release
ARG OPERATOR_REF=v0.8.0

# build mysql-operator-sidecar
WORKDIR /build
RUN wget -O extra_image.zip https://github.com/ksmartdata/mysql-operator/archive/refs/heads/extra_image.zip
RUN unzip extra_image.zip
WORKDIR /build/mysql-operator-extra_image
RUN wget -O src.zip https://github.com/ksmartdata/mysql-operator/archive/${OPERATOR_REF}.zip
RUN unzip src.zip && mv mysql-operator-* mysql-operator-src
WORKDIR /build/mysql-operator-src
RUN go mod tidy
RUN CGO_ENABLED=0 go build -o /mysql-operator-sidecar cmd/mysql-operator-sidecar/main.go

# install rclone
RUN curl https://rclone.org/install.sh | bash

FROM --platform=$TARGETPLATFORM jiuker/mysql-operator-sidecar-5.7:v0.6.2

Check warning on line 28 in images/mysql-operator-sidecar-5.7/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-5.7)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/

Check warning on line 28 in images/mysql-operator-sidecar-5.7/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-5.7)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/
USER root
COPY --from=builder /mysql-operator-sidecar /usr/local/bin/
COPY --from=builder /usr/bin/rclone /usr/local/bin/
Expand Down
17 changes: 13 additions & 4 deletions images/mysql-operator-sidecar-8.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM --platform=$TARGETPLATFORM golang:1.21.11 as builder
# keep the Go version current: the stdlib compiled into the sidecar binary
# is what the trivy CRITICAL gate scans (see the 8.4 image)
FROM --platform=$TARGETPLATFORM golang:1.26-bookworm as builder

Check warning on line 3 in images/mysql-operator-sidecar-8.0/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-8.0)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/

Check warning on line 3 in images/mysql-operator-sidecar-8.0/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-8.0)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 3 in images/mysql-operator-sidecar-8.0/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-8.0)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/

Check warning on line 3 in images/mysql-operator-sidecar-8.0/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-8.0)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

USER root

Expand All @@ -8,19 +10,26 @@
ENV GOPROXY=https://goproxy.cn
ENV GOPATH=/build

# pinned mysql-operator ref (tag or commit - repo policy forbids pulling
# from branch heads); bump via build-args when cutting a new release
ARG OPERATOR_REF=v0.8.0

# build mysql-operator-sidecar
WORKDIR /build
RUN wget -O arm64.zip https://github.com/ksmartdata/mysql-operator/archive/refs/heads/extra_image.zip
RUN unzip arm64.zip
WORKDIR /build/mysql-operator-extra_image
RUN wget -O src.zip https://github.com/ksmartdata/mysql-operator/archive/${OPERATOR_REF}.zip
RUN unzip src.zip && mv mysql-operator-* mysql-operator-src
WORKDIR /build/mysql-operator-src
RUN go mod tidy
RUN CGO_ENABLED=0 go build -o /mysql-operator-sidecar cmd/mysql-operator-sidecar/main.go

# install rclone
RUN curl https://rclone.org/install.sh | bash

FROM --platform=$TARGETPLATFORM ghcr.io/ksmartdata/mysql-operator-sidecar-8.0:v0.7.4

Check warning on line 28 in images/mysql-operator-sidecar-8.0/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-8.0)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/

Check warning on line 28 in images/mysql-operator-sidecar-8.0/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-8.0)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/
USER root
# the v0.7.4 base ships a full Go toolchain at /usr/local/go; a runtime
# image needs no compiler and trivy gates on its stale stdlib CVEs
RUN rm -rf /usr/local/go
COPY --from=builder /mysql-operator-sidecar /usr/local/bin/
COPY --from=builder /usr/bin/rclone /usr/local/bin/
RUN chmod +x /usr/local/bin/mysql-operator-sidecar
Expand Down
10 changes: 7 additions & 3 deletions images/mysql-operator-sidecar-8.0/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ RUN apt install -y wget gcc unzip
ENV GOPROXY=https://goproxy.cn
ENV GOPATH=/build

# pinned mysql-operator ref (tag or commit - repo policy forbids pulling
# from branch heads); bump via build-args when cutting a new release
ARG OPERATOR_REF=v0.8.0

WORKDIR /build
RUN wget -O extra_image.zip https://github.com/ksmartdata/mysql-operator/archive/refs/heads/extra_image.zip
RUN unzip extra_image.zip
WORKDIR /build/mysql-operator-extra_image
RUN wget -O src.zip https://github.com/ksmartdata/mysql-operator/archive/${OPERATOR_REF}.zip
RUN unzip src.zip && mv mysql-operator-* mysql-operator-src
WORKDIR /build/mysql-operator-src
RUN go mod tidy
RUN CGO_ENABLED=0 go build -o /mysql-operator-sidecar cmd/mysql-operator-sidecar/main.go

Expand Down
6 changes: 3 additions & 3 deletions images/mysql-operator-sidecar-8.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
# build mysql-operator-sidecar from the operator fork; the Go version also
# pins the stdlib compiled into the binary - keep it current or the trivy
# CRITICAL gate rejects the image (the module itself builds fine on new Go)
FROM --platform=$TARGETPLATFORM golang:1.26-bookworm AS builder

Check warning on line 14 in images/mysql-operator-sidecar-8.4/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-8.4)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/

Check warning on line 14 in images/mysql-operator-sidecar-8.4/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-8.4)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/

# Release convention: tag the mysql-operator repo first (e.g. v0.8.0), then
# dispatch the build with build-args OPERATOR_REF=<that tag> so the sidecar
# binary is pinned to an exact commit (git clone --branch accepts tags).
# The default only exists for ad-hoc builds and floats with the branch head.
ARG OPERATOR_REF=extra_image
# The default is pinned to the latest release tag; bump it per release.
ARG OPERATOR_REF=v0.8.0

# git is bundled with the golang image (wget/unzip are not)
RUN git clone --depth 1 --branch ${OPERATOR_REF} \
Expand All @@ -26,7 +26,7 @@
RUN CGO_ENABLED=0 go build -o /mysql-operator-sidecar ./cmd/mysql-operator-sidecar

# runtime: EL9 (matches Percona's own PXB 8.4 image base)
FROM --platform=$TARGETPLATFORM oraclelinux:9

Check warning on line 29 in images/mysql-operator-sidecar-8.4/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-8.4)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/

Check warning on line 29 in images/mysql-operator-sidecar-8.4/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-scan (mysql-operator-sidecar-8.4)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/

# -o: uid/gid 999 must match the other sidecar images (the operator runs the
# pod with this identity), but EL9 already assigns 999 to a system account
Expand Down Expand Up @@ -62,7 +62,7 @@

# re-declared so the builder-stage ARG is visible here; records which
# mysql-operator ref the embedded sidecar binary was built from
ARG OPERATOR_REF=extra_image
ARG OPERATOR_REF=v0.8.0
LABEL io.ksmartdata.operator-ref=${OPERATOR_REF}

COPY --from=builder /mysql-operator-sidecar /usr/local/bin/mysql-operator-sidecar
Expand Down
Loading