Skip to content

Commit 75883b8

Browse files
committed
fix build in github
Signed-off-by: Oliver Trosien <oliver.trosien@zalando.de>
1 parent 076ed90 commit 75883b8

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
make lint
1919
make
2020
make build/linux/e2e
21-
IMAGE=es-operator VERSION=local make build.docker.ghcr
21+
IMAGE=es-operator VERSION=local make build.docker.local
2222
- run: goveralls -coverprofile=profile.cov -service=github
2323
env:
2424
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docker-multiarch.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ jobs:
5656
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5757
tags: |
5858
type=ref,event=branch
59-
type=ref,event=pr
59+
type=ref,event=pr,prefix=pr-
6060
type=semver,pattern={{version}}
6161
type=semver,pattern={{major}}.{{minor}}
6262
type=semver,pattern={{major}}
6363
type=raw,value=latest,enable={{is_default_branch}}
64-
type=sha,prefix={{branch}}-
64+
type=sha,prefix={{branch}}-,enable={{is_default_branch}}
65+
type=sha,prefix=pr-,enable=${{ github.event_name == 'pull_request' }}
6566
6667
- name: Build multiarch binaries
6768
run: |

Dockerfile.ghcr

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ COPY --chmod=0644 docker-context/dnf.conf /sysroot/etc/dnf/dnf.conf
77
RUN dnf --refresh --releasever=latest --installroot /sysroot -y \
88
--setopt=install_weak_deps=False --setopt=fastestmirror=True \
99
--setopt=max_parallel_downloads=10 --setopt=deltarpm=True \
10+
--setopt=tsflags=noscripts \
1011
--nodocs install bash coreutils-single curl-minimal microdnf microdnf-dnf glibc-minimal-langpack gnupg2-minimal && \
1112
echo 'latest' > /sysroot/etc/dnf/vars/releasever && \
1213
dnf clean all --installroot /sysroot
1314

14-
FROM container-registry.zalando.net/library/scratch:latest
15+
FROM scratch
1516

1617
LABEL maintainer="Team Pandora @ Zalando SE <team-pandora@zalando.de>"
1718

@@ -23,4 +24,4 @@ WORKDIR /
2324
ARG TARGETARCH
2425
COPY build/linux/${TARGETARCH}/es-operator /es-operator
2526

26-
ENTRYPOINT ["/es-operator"]
27+
ENTRYPOINT ["/es-operator"]

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,9 @@ build.multiarch: $(GENERATED) $(SOURCES)
8383
build.docker.ghcr: build.multiarch
8484
docker buildx build --platform linux/amd64,linux/arm64 -t "$(IMAGE):$(TAG)" -f Dockerfile.ghcr .
8585

86+
# Local build target for e2e testing (single arch with --load)
87+
build.docker.local: build.multiarch
88+
docker buildx build --platform linux/amd64 -t "$(IMAGE):$(TAG)" -f Dockerfile.ghcr --load .
89+
8690
build.push.ghcr: build.multiarch
8791
docker buildx build --platform linux/amd64,linux/arm64 -t "$(IMAGE):$(TAG)" -f Dockerfile.ghcr --push .

0 commit comments

Comments
 (0)