File tree Expand file tree Collapse file tree 3 files changed +22
-15
lines changed
Expand file tree Collapse file tree 3 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -20,21 +20,28 @@ jobs:
2020 IMAGE_REGISTRY : ghcr.io/oracle
2121 steps :
2222 - name : Checkout
23- uses : actions/checkout@v3.3.0
23+ uses : actions/checkout@v4
2424
2525 - name : Set up QEMU
26- uses : docker/setup-qemu-action@v2
26+ uses : docker/setup-qemu-action@v3
2727 with :
28- platforms : amd64
28+ platforms : linux/ amd64,linux/arm64
2929
3030 - name : Set up Docker Buildx
31- uses : docker/setup-buildx-action@v2
31+ uses : docker/setup-buildx-action@v3
3232
33- - name : Log into GitHub Container Registry
34- run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${GITHUB_ACTOR,,} --password-stdin
35-
36- - name : Build Image
37- run : REGISTRY="${{ env.IMAGE_REGISTRY }}" VERSION="${{ github.ref_name }}" make image
33+ - name : Login to Docker
34+ uses : docker/login-action@v3
35+ with :
36+ registry : ghcr.io
37+ username : ${{ github.actor }}
38+ password : ${{ secrets.GITHUB_TOKEN }}
3839
39- - name : Push Image
40- run : REGISTRY="${{ env.IMAGE_REGISTRY }}" VERSION="${{ github.ref_name }}" make push
40+ - name : Build and push
41+ uses : docker/build-push-action@v5
42+ with :
43+ context : .
44+ platforms : linux/amd64,linux/arm64
45+ push : true
46+ provenance : false
47+ tags : ghcr.io/oracle/oci-native-ingress-controller:${{ github.ref_name }}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ COPY . ./
1818# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
1919# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
2020# RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
21- RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -mod vendor -a -o dist/onic ./main.go
21+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on go build -mod vendor -a -o dist/onic ./main.go
2222
2323# For Open source
2424FROM oraclelinux:7-slim
@@ -34,4 +34,4 @@ COPY THIRD_PARTY_LICENSES.txt .
3434# Copy the manager binary
3535COPY --from=builder /workspace/dist/onic .
3636
37- ENTRYPOINT ["/usr/local/bin/oci-native-ingress-controller/onic" ]
37+ ENTRYPOINT ["/usr/local/bin/oci-native-ingress-controller/onic" ]
Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ version:
5959
6060# Currently only supports amd
6161build : ./main.go
62- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -mod vendor -a -o dist/onic ./main.go
62+ CGO_ENABLED=0 GOOS=$( GOOS ) GOARCH=$( GOARCH ) GO111MODULE=on go build -mod vendor -a -o dist/onic ./main.go
6363
6464image :
65- docker build -t ${IMAGE_PATH} -f Dockerfile .
65+ docker build --build-arg goos= $( GOOS ) --build-arg goarch= $( GOARCH ) - t ${IMAGE_PATH} -f Dockerfile .
6666
6767push :
6868 docker push ${IMAGE_PATH}
You can’t perform that action at this time.
0 commit comments