Skip to content

Commit

Permalink
try github.com/crazy-max/xgo@latest xgo (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
edcdavid authored Oct 14, 2024
1 parent 0ef3cff commit 932ecc8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-latest-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
xgo_version: latest
go_version: 1.22
dest: .
dest: github/redhat-cne
prefix: l2discovery
targets: linux/amd64,linux/arm64
v: true
Expand All @@ -58,4 +58,4 @@ jobs:

- name: Build and push image
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'redhat-cne' }}
run: ./scripts/image.sh
run: ./scripts/image.sh ci
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM registry.access.redhat.com/ubi9/ubi@sha256:9e6a89ab2a9224712391c77fab2ab01009e387aff42854826427aaf18b98b1ff
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/ubi@sha256:9e6a89ab2a9224712391c77fab2ab01009e387aff42854826427aaf18b98b1ff
RUN dnf -y --disableplugin=subscription-manager install iputils iproute ethtool pciutils

Check failure on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / Run Linters, Vet and unit tests

DL3040 warning: `dnf clean all` missing after dnf command.

Check failure on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / Run Linters, Vet and unit tests

DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
RUN dnf -y --disableplugin=subscription-manager remove python3-setuptools

Check failure on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / Run Linters, Vet and unit tests

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
COPY l2discovery-linux-amd64 /usr/bin
COPY l2discovery-linux-arm64 /usr/bin
COPY github.com/redhat-cne/l2discovery-linux-amd64 /usr/bin
COPY github.com/redhat-cne/l2discovery-linux-arm64 /usr/bin
RUN \
if [ "$(uname -m)" = x86_64 ]; then \
echo "Detected x86_64 CPU architecture."; \
mv /usr/bin/l2discovery-linux-amd64 /usr/bin/l2discovery; \
elif [ "$(uname -m)" = aarch64 ]; then \
echo "Detected aarch64 CPU architecture."; \
mv /usr/bin/l2discovery-linux-arm64 /usr/bin/l2discovery; \
else \
echo "CPU architecture is not supported." && exit 1; \
Expand Down
12 changes: 8 additions & 4 deletions scripts/image.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/sh
set -x
#!/usr/bin/env bash
VERSION=latest
IMAGE_NAME=l2discovery
REPO=quay.io/redhat-cne
make test
go install github.com/karalabe/xgo@latest
xgo --targets=linux/arm64,linux/amd64 .

if [[ $# -eq 0 ]]; then
echo "Running locally"
go install github.com/crazy-max/xgo@latest
mkdir -p /tmp/xgo-cache
xgo --targets=linux/arm64,linux/amd64 .
fi
podman manifest create ${REPO}/${IMAGE_NAME}:${VERSION}
podman build --platform linux/amd64,linux/arm64 --manifest ${REPO}/${IMAGE_NAME}:${VERSION} --rm -f Dockerfile .
podman manifest push ${REPO}/${IMAGE_NAME}:${VERSION}
2 changes: 1 addition & 1 deletion scripts/launch.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
#!/usr/bin/env bash

oc apply -f resources/daemonset.yml

0 comments on commit 932ecc8

Please sign in to comment.