File tree 3 files changed +22
-15
lines changed
3 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -20,21 +20,28 @@ jobs:
20
20
IMAGE_REGISTRY : ghcr.io/oracle
21
21
steps :
22
22
- name : Checkout
23
- uses : actions/checkout@v3.3.0
23
+ uses : actions/checkout@v4
24
24
25
25
- name : Set up QEMU
26
- uses : docker/setup-qemu-action@v2
26
+ uses : docker/setup-qemu-action@v3
27
27
with :
28
- platforms : amd64
28
+ platforms : linux/ amd64,linux/arm64
29
29
30
30
- name : Set up Docker Buildx
31
- uses : docker/setup-buildx-action@v2
31
+ uses : docker/setup-buildx-action@v3
32
32
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 }}
38
39
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 . ./
18
18
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
19
19
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
20
20
# 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
22
22
23
23
# For Open source
24
24
FROM oraclelinux:7-slim
@@ -34,4 +34,4 @@ COPY THIRD_PARTY_LICENSES.txt .
34
34
# Copy the manager binary
35
35
COPY --from=builder /workspace/dist/onic .
36
36
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:
59
59
60
60
# Currently only supports amd
61
61
build : ./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
63
63
64
64
image :
65
- docker build -t ${IMAGE_PATH} -f Dockerfile .
65
+ docker build --build-arg goos= $( GOOS ) --build-arg goarch= $( GOARCH ) - t ${IMAGE_PATH} -f Dockerfile .
66
66
67
67
push :
68
68
docker push ${IMAGE_PATH}
You can’t perform that action at this time.
0 commit comments