Skip to content

Commit

Permalink
fix: more updates to support both archs
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmmatos committed Apr 12, 2024
1 parent e3318db commit 8962421
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
FROM registry.access.redhat.com/ubi9/ubi as builder

# Get target architecture
ARG TARGETARCH

RUN dnf install -y unzip golang-bin git

# eksctl cli
RUN curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp
RUN PLATFORM=$(uname -s)_${TARGETARCH} && \
curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz" && \
curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check && \
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && \
rm eksctl_$PLATFORM.tar.gz

# helm
RUN curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
Expand All @@ -24,19 +31,21 @@ COPY --from=builder /root/go/bin/docker-credential-ecr-login /usr/bin/falcon_sen
COPY --from=builder /root/.local/bin/k9s /bin/
COPY .docker /root/.docker
COPY demo-yamls /root/demo-yamls
COPY kubernetes.repo google-cloud-sdk.repo azure-cli.repo /etc/yum.repos.d/
COPY kubernetes.repo google-cloud-sdk.repo /etc/yum.repos.d/
COPY falcon-node-sensor-build falcon-node-sensor-push falcon-container-sensor-push falcon-image-pull-token /bin/

RUN : \
&& dnf update -y \
&& dnf install -y kubectl groff-base bash-completion google-cloud-sdk git \
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& ARCH=$(uname -m) \
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH.zip" -o "awscliv2.zip" \
&& dnf install -y zip \
&& unzip awscliv2.zip \
&& dnf history undo last -y \
&& ./aws/install \
&& curl https://download.docker.com/linux/centos/docker-ce.repo > /etc/yum.repos.d/docker-ce.repo \
&& rpm --import https://packages.microsoft.com/keys/microsoft.asc \
&& dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm \
&& dnf install -y docker-ce docker-ce-cli containerd.io azure-cli \
&& dnf install -y skopeo --nobest --allowerasing jq \
&& dnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ IMG ?= cloud-tools-image:latest
# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=<myregistry/image:<tag>> than the export will fail)
# To properly provided solutions that supports more than one platform you should use this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
PLATFORMS ?= linux/arm64,linux/amd64
.PHONY: docker-buildx
docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-sdk.repo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-x86_64
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
Expand Down

0 comments on commit 8962421

Please sign in to comment.