Skip to content

Commit

Permalink
Don't use platform in FROM in dockerfile, remove TARGETOSIMAGE, ignor…
Browse files Browse the repository at this point in the history
…e int tests for now
  • Loading branch information
akondur committed Nov 7, 2024
1 parent a5d7225 commit 1555d21
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/graviton-build-test-push-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
export BUILDPLATFORM=linux/arm64
export TARGETOS=linux
export TARGETARCH=arm64
docker buildx build --push --platform=linux/arm64,linux/amd64 --build-arg TARGETOSIMAGE=public.ecr.aws/amazonlinux/amazonlinux:2023.0.20211014 --tag ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA -f Dockerfile.graviton .
docker buildx build --push --platform=linux/arm64,linux/amd64 --tag ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA -f Dockerfile.graviton .
- name: Sign Splunk Operator image with a key
run: |
cosign sign --yes --key env://COSIGN_PRIVATE_KEY ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ github.sha }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/graviton-int-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Graviton Integration Test WorkFlow
on:
push:
branches:
- CSPL_2920
- CSPL_2920_xxxx
jobs:
build-operator-image-graviton:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
export BUILDPLATFORM=linux/arm64
export TARGETOS=linux
export TARGETARCH=arm64
docker buildx build --push --platform=linux/arm64,linux/amd64 --build-arg TARGETOSIMAGE=public.ecr.aws/amazonlinux/amazonlinux:2023.0.20211014 --tag ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA -f Dockerfile.graviton .
docker buildx build --push --platform=linux/arm64,linux/amd64 --tag ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA -f Dockerfile.graviton .
int-tests-graviton:
strategy:
fail-fast: false
Expand Down
20 changes: 10 additions & 10 deletions Dockerfile.graviton
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.23.0 as builder
FROM golang:1.23.0 as builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM
Expand Down Expand Up @@ -27,18 +27,18 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o manager m

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM --platform=${BUILDPLATFORM:-linux/amd64} amazonlinux:2023.6.20241010.0
FROM public.ecr.aws/amazonlinux/amazonlinux:2023

ENV OPERATOR=/manager \
USER_UID=1001 \
USER_NAME=nonroot

RUN yum -y install shadow-utils
RUN useradd -ms /bin/bash nonroot -u 1001
RUN yum update -y krb5-libs && yum clean all
RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical
RUN yum -y update-minimal --security --sec-severity=Moderate
RUN yum -y update-minimal --security --sec-severity=Low
RUN yum -y install shadow-utils && \
useradd -ms /bin/bash nonroot -u 1001 && \
yum update -y krb5-libs && yum clean all && \
yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \
yum -y update-minimal --security --sec-severity=Moderate && \
yum -y update-minimal --security --sec-severity=Low

LABEL name="splunk" \
maintainer="support@splunk.com" \
Expand All @@ -49,8 +49,8 @@ LABEL name="splunk" \
description="The Splunk Operator for Kubernetes (SOK) makes it easy for Splunk Administrators to deploy and operate Enterprise deployments in a Kubernetes infrastructure. Packaged as a container, it uses the operator pattern to manage Splunk-specific custom resources, following best practices to manage all the underlying Kubernetes objects for you."

WORKDIR /
RUN mkdir /licenses
RUN mkdir -p /tools/k8_probes
RUN mkdir /licenses && \
mkdir -p /tools/k8_probes

COPY --from=builder /workspace/manager .
COPY tools/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf /licenses
Expand Down

0 comments on commit 1555d21

Please sign in to comment.