forked from bitpoke/mysql-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
guozhi.li
committed
Dec 7, 2022
1 parent
b9d2116
commit d83157f
Showing
2 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ env: | |
ONLINE_REGISTER: ghcr.io/ksmartdata | ||
BUILD_PLATFORM: linux/amd64,linux/arm64 | ||
jobs: | ||
ot-redis: | ||
rabbitmq-cluster-operator: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git clone mysql-operator repo | ||
|
@@ -27,14 +27,14 @@ jobs: | |
- name: mysql-operator | ||
uses: docker/[email protected] | ||
with: | ||
context: ./arm64/images/ot-redis | ||
file: ./arm64/images/ot-redis/Dockerfile-release | ||
context: ./arm64/images/rabbitmq-cluster-operator | ||
file: ./arm64/images/rabbitmq-cluster-operator/Dockerfile | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
push: true | ||
platforms: ${{ env.BUILD_PLATFORM }} | ||
tags: | | ||
${{ env.ONLINE_REGISTER }}/ot-redis:v6.2.5-alpine | ||
${{ env.ONLINE_REGISTER }}/ot-redis:latest | ||
${{ env.ONLINE_REGISTER }}/rabbitmq-cluster-operator:v1.14.0 | ||
${{ env.ONLINE_REGISTER }}/rabbitmq-cluster-operator:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
# ot-redis-operator: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Build the manager binary | ||
FROM --platform=$TARGETPLATFORM golang:1.19 as builder | ||
|
||
USER root | ||
|
||
RUN apt update -y | ||
|
||
RUN apt install -y wget gcc unzip | ||
ENV GOPROXY=https://goproxy.cn | ||
ENV GOPATH=/build | ||
|
||
WORKDIR /build | ||
RUN wget -O arm64.zip https://github.com/rabbitmq/cluster-operator/archive/refs/tags/v1.14.0.zip | ||
RUN unzip arm64.zip | ||
WORKDIR /build/cluster-operator-1.14.0 | ||
RUN go mod tidy | ||
# Build | ||
RUN CGO_ENABLED=0 GO111MODULE=on go build -a -tags timetzdata -o manager main.go | ||
|
||
# --------------------------------------- | ||
FROM --platform=$TARGETPLATFORM alpine:latest as etc-builder | ||
|
||
RUN echo "rabbitmq-cluster-operator:x:1000:" > /etc/group && \ | ||
echo "rabbitmq-cluster-operator:x:1000:1000::/home/rabbitmq-cluster-operator:/usr/sbin/nologin" > /etc/passwd | ||
|
||
RUN apk add -U --no-cache ca-certificates | ||
|
||
# --------------------------------------- | ||
FROM --platform=$TARGETPLATFORM scratch | ||
|
||
ARG GIT_COMMIT | ||
LABEL GitCommit=$GIT_COMMIT | ||
|
||
WORKDIR / | ||
COPY --from=builder /build/cluster-operator-1.14.0/manager . | ||
COPY --from=etc-builder /etc/passwd /etc/group /etc/ | ||
COPY --from=etc-builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
|
||
USER 1000:1000 | ||
|
||
ENTRYPOINT ["/manager"] |