Skip to content

Commit

Permalink
Fix docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
akondur committed Nov 15, 2024
1 parent e56a203 commit 6c9b789
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-test-push-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ jobs:
uses: aws-actions/amazon-ecr-login@v1
- name: Re-tag Splunk Operator Image
run: |
docker pull ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
docker buildx imagetools create -t ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }} ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
docker tag ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}
- name: Push Splunk Operator Image to Docker Hub
run: docker push ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}
3 changes: 1 addition & 2 deletions .github/workflows/int-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ jobs:
uses: aws-actions/amazon-ecr-login@v1
- name: Pull Splunk Operator Image Locally and change name
run: |
docker pull ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
docker buildx imagetools create -t ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
docker tag ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
- name: Tag and Push Splunk Enterprise Image to ECR
run: |
docker tag ${{ env.SPLUNK_ENTERPRISE_IMAGE }} ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ COPY hack hack/
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o manager main.go

# Use BASE_OS as the base image
FROM ${BASE_OS}:{BASE_OS_VERSION}
FROM ${BASE_OS}:${BASE_OS_VERSION}

ENV OPERATOR=/manager \
USER_UID=1001 \
Expand Down
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,21 @@ docker-push: ## Push docker image with the manager.
# Build Base OS: registry.access.redhat.com/ubi8/ubi
# Build Base OS Version: 8.10
# Pass only what is required, the rest will be defaulted
docker-buildx:
docker buildx build --push --platform=${PLATFORMS} \
--build-arg BASE_OS=${BASE_OS} \
--build-arg BASE_OS_VERSION=${BASE_OS_VERSION} \
--tag ${IMG} -f Dockerfile .
# Setup defaults for build arguments
PLATFORMS ?= linux/amd64
BASE_OS ?= registry.access.redhat.com/ubi8/ubi
BASE_OS_VERSION ?= 8.10
docker-buildx:
@if [ -z "$(IMG)" ]; then \
echo "Error: IMG is a mandatory argument. Usage: make docker-buildx IMG=<image_name> ...."; \
exit 1; \
fi
docker buildx build --push --platform="${PLATFORMS}" \
--build-arg BASE_OS="${BASE_OS}" \
--build-arg BASE_OS_VERSION="${BASE_OS_VERSION}" \
--tag "${IMG}" -f Dockerfile .

##@ Deployment

install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply --server-side --force-conflicts -f -

Expand Down
1 change: 0 additions & 1 deletion test/testenv/verificationutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func StandaloneReady(ctx context.Context, deployment *Deployment, deploymentName
}
testenvInstance.Log.Info("Waiting for Standalone phase to be ready", "instance", standalone.ObjectMeta.Name, "Phase", standalone.Status.Phase)
DumpGetPods(testenvInstance.GetName())
//DumpDescribePods(testenvInstance.GetName())
DumpGetTopPods(testenvInstance.GetName())
DumpGetTopNodes()
return standalone.Status.Phase
Expand Down

0 comments on commit 6c9b789

Please sign in to comment.