Skip to content

Commit 7017138

Browse files
authored
Merge pull request #179 from crazy-max/cross-compo-target
dockerfile: use cross-comp target to avoid emulation
2 parents df22b90 + e654a06 commit 7017138

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ jobs:
9898
TELEMETRY_HEADER: ${{ secrets.TELEMETRY_HEADER }}
9999

100100
build-image:
101-
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
102-
needs: [build]
101+
needs:
102+
- build
103103
runs-on: ubuntu-latest
104104
steps:
105105
- name: Checkout
@@ -124,8 +124,9 @@ jobs:
124124
with:
125125
images: docker/cagent
126126
tags: |
127-
type=raw,value=latest,enable={{is_default_branch}}
128-
type=ref,event=tag
127+
type=semver,pattern={{version}}
128+
type=edge
129+
type=ref,event=pr
129130
130131
- name: Build and push image
131132
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ FROM scratch AS cross
8686
COPY --from=builder /binaries .
8787

8888
FROM alpine:3.22@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
89-
COPY --from=build-agent /agent /cagent
89+
ARG TARGETOS TARGETARCH
90+
COPY --from=builder /binaries/cagent-$TARGETOS-$TARGETARCH /cagent
9091
RUN mkdir /data
9192
ENTRYPOINT ["/cagent"]

0 commit comments

Comments
 (0)