Skip to content

Commit 6c9b789

Browse files
committed
Fix docker builds
1 parent e56a203 commit 6c9b789

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

.github/workflows/build-test-push-workflow.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ jobs:
332332
uses: aws-actions/amazon-ecr-login@v1
333333
- name: Re-tag Splunk Operator Image
334334
run: |
335-
docker pull ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
336-
docker buildx imagetools create -t ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }} ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
335+
docker tag ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}
337336
- name: Push Splunk Operator Image to Docker Hub
338337
run: docker push ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}

.github/workflows/int-test-workflow.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ jobs:
154154
uses: aws-actions/amazon-ecr-login@v1
155155
- name: Pull Splunk Operator Image Locally and change name
156156
run: |
157-
docker pull ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
158-
docker buildx imagetools create -t ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
157+
docker tag ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
159158
- name: Tag and Push Splunk Enterprise Image to ECR
160159
run: |
161160
docker tag ${{ env.SPLUNK_ENTERPRISE_IMAGE }} ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ COPY hack hack/
2727
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o manager main.go
2828

2929
# Use BASE_OS as the base image
30-
FROM ${BASE_OS}:{BASE_OS_VERSION}
30+
FROM ${BASE_OS}:${BASE_OS_VERSION}
3131

3232
ENV OPERATOR=/manager \
3333
USER_UID=1001 \

Makefile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,21 @@ docker-push: ## Push docker image with the manager.
150150
# Build Base OS: registry.access.redhat.com/ubi8/ubi
151151
# Build Base OS Version: 8.10
152152
# Pass only what is required, the rest will be defaulted
153-
docker-buildx:
154-
docker buildx build --push --platform=${PLATFORMS} \
155-
--build-arg BASE_OS=${BASE_OS} \
156-
--build-arg BASE_OS_VERSION=${BASE_OS_VERSION} \
157-
--tag ${IMG} -f Dockerfile .
153+
# Setup defaults for build arguments
154+
PLATFORMS ?= linux/amd64
155+
BASE_OS ?= registry.access.redhat.com/ubi8/ubi
156+
BASE_OS_VERSION ?= 8.10
157+
docker-buildx:
158+
@if [ -z "$(IMG)" ]; then \
159+
echo "Error: IMG is a mandatory argument. Usage: make docker-buildx IMG=<image_name> ...."; \
160+
exit 1; \
161+
fi
162+
docker buildx build --push --platform="${PLATFORMS}" \
163+
--build-arg BASE_OS="${BASE_OS}" \
164+
--build-arg BASE_OS_VERSION="${BASE_OS_VERSION}" \
165+
--tag "${IMG}" -f Dockerfile .
158166

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

test/testenv/verificationutils.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ func StandaloneReady(ctx context.Context, deployment *Deployment, deploymentName
9494
}
9595
testenvInstance.Log.Info("Waiting for Standalone phase to be ready", "instance", standalone.ObjectMeta.Name, "Phase", standalone.Status.Phase)
9696
DumpGetPods(testenvInstance.GetName())
97-
//DumpDescribePods(testenvInstance.GetName())
9897
DumpGetTopPods(testenvInstance.GetName())
9998
DumpGetTopNodes()
10099
return standalone.Status.Phase

0 commit comments

Comments
 (0)