forked from redhat-best-practices-for-k8s/l2discovery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* try xgo github action * fix lint
- Loading branch information
Showing
3 changed files
with
33 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
FROM registry.access.redhat.com/ubi9/ubi@sha256:9e6a89ab2a9224712391c77fab2ab01009e387aff42854826427aaf18b98b1ff | ||
RUN dnf -y install iputils iproute ethtool pciutils; dnf clean all | ||
RUN dnf -y remove python3-setuptools | ||
COPY l2discovery-linux-amd64 /usr/bin | ||
COPY l2discovery-linux-arm64 /usr/bin | ||
RUN \ | ||
if [ "$(uname -m)" = x86_64 ]; then \ | ||
mv /usr/bin/l2discovery-linux-amd64 /usr/bin/l2discovery; \ | ||
elif [ "$(uname -m)" = aarch64 ]; then \ | ||
mv /usr/bin/l2discovery-linux-arm64 /usr/bin/l2discovery; \ | ||
else \ | ||
echo "CPU architecture is not supported." && exit 1; \ | ||
fi | ||
COPY l2discovery /usr/bin | ||
USER 0 | ||
CMD ["/bin/sh", "-c", "/usr/bin/l2discovery"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
#!/bin/sh | ||
set -x | ||
VERSION=latest | ||
VERSION=multi | ||
IMAGE_NAME=l2discovery | ||
REPO=quay.io/redhat-cne | ||
make test | ||
go build l2discovery.go | ||
podman build -t ${IMAGE_NAME} --rm -f Dockerfile . | ||
podman tag ${IMAGE_NAME} ${REPO}/${IMAGE_NAME}:${VERSION} | ||
podman push ${REPO}/${IMAGE_NAME}:${VERSION} | ||
go install github.com/karalabe/xgo@latest | ||
xgo --targets=linux/arm64,linux/amd64 . | ||
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} |