mirror of
https://github.com/kubereboot/kured.git
synced 2026-02-14 17:39:49 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9a5d3b53a | ||
|
|
32783886fb | ||
|
|
e1db60b2b5 | ||
|
|
f3295b99ef |
26
.github/workflows/on-main-push.yaml
vendored
26
.github/workflows/on-main-push.yaml
vendored
@@ -36,10 +36,24 @@ jobs:
|
||||
username: weave-ghcr-bot
|
||||
password: ${{ secrets.KURED_WEAVE_GHCR_BOT_TOKEN }}
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
make DH_ORG="${{ github.repository_owner }}" image
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Publish image
|
||||
run: |
|
||||
make DH_ORG="${{ github.repository_owner }}" publish-image
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Find current tag version
|
||||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
id: tags
|
||||
|
||||
- name: Build image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: cmd/kured/Dockerfile.multi
|
||||
platforms: linux/arm64, linux/amd64
|
||||
push: true
|
||||
tags: |
|
||||
docker.io/${{ GITHUB.REPOSITORY }}:main-${{ steps.tags.outputs.sha_short }}
|
||||
ghcr.io/${{ GITHUB.REPOSITORY }}:main-${{ steps.tags.outputs.sha_short }}
|
||||
|
||||
22
.github/workflows/on-tag.yaml
vendored
22
.github/workflows/on-tag.yaml
vendored
@@ -44,6 +44,22 @@ jobs:
|
||||
username: weave-ghcr-bot
|
||||
password: ${{ secrets.KURED_WEAVE_GHCR_BOT_TOKEN }}
|
||||
|
||||
- name: Publish image
|
||||
run: |
|
||||
make DH_ORG="${{ github.repository_owner }}" VERSION="${{ steps.tags.outputs.version }}" publish-image
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: cmd/kured/Dockerfile.multi
|
||||
platforms: linux/arm64, linux/amd64, linux/arm/v7, linux/arm/v6, linux/386
|
||||
push: true
|
||||
# cache-from: type=registry,ref=user/app:buildcache
|
||||
# cache-to: type=inline
|
||||
tags: |
|
||||
docker.io/${{ GITHUB.REPOSITORY }}:${{ steps.tags.outputs.version }}
|
||||
ghcr.io/${{ GITHUB.REPOSITORY }}:${{ steps.tags.outputs.version }}
|
||||
|
||||
21
cmd/kured/Dockerfile.multi
Normal file
21
cmd/kured/Dockerfile.multi
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM --platform=$BUILDPLATFORM golang:bullseye AS build
|
||||
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
|
||||
ENV GOOS=$TARGETOS
|
||||
ENV GOARCH=$TARGETARCH
|
||||
ENV GOVARIANT=$TARGETVARIANT
|
||||
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum .
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN go list -f '{{join .Deps "\n"}}' ./cmd/kured | grep -v /vendor/ | xargs go list -f '{{if not .Standard}}{{ $dep := . }}{{range .GoFiles}}{{$dep.Dir}}/{{.}} {{end}}{{end}}'
|
||||
RUN CGO_ENABLED=0 go build -o cmd/kured/kured cmd/kured/*.go
|
||||
|
||||
FROM --platform=$TARGETPLATFORM alpine:3.15 as bin
|
||||
RUN apk update --no-cache && apk upgrade --no-cache && apk add --no-cache ca-certificates tzdata
|
||||
COPY --from=build /src/cmd/kured/kured /usr/bin/kured
|
||||
ENTRYPOINT ["/usr/bin/kured"]
|
||||
Reference in New Issue
Block a user