Skip to content

Commit

Permalink
rabbitmq
Browse files Browse the repository at this point in the history
  • Loading branch information
guozhi.li committed Dec 7, 2022
1 parent b9d2116 commit d83157f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
41 changes: 41 additions & 0 deletions arm64/images/rabbitmq-cluster-operator/Dockerfile
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"]

0 comments on commit d83157f

Please sign in to comment.