Skip to content

Commit

Permalink
Fix relative path for Dockerfile
Browse files Browse the repository at this point in the history
The Dockerfile was moved, so it was no longer
finding the script files.
Also, move the `kubeconfig` generation so it's not
regenerated on every run.

Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
  • Loading branch information
dhaiducek authored and openshift-merge-bot[bot] committed Dec 4, 2024
1 parent a8bfbde commit 3f3fb2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.PHONY: clean
clean:
-rm -rf must-gather/
-rm kubeconfig

############################################################
# run section
Expand All @@ -14,10 +15,12 @@ clean:
run: clean
./collection-scripts/gather

kubeconfig:
oc config view --minify --raw > kubeconfig

.PHONY: run-image
run-image:
run-image: kubeconfig
-mkdir must-gather/
oc config view --minify --raw > kubeconfig
${CONTAINER_ENGINE} run -v $(PWD)/kubeconfig:/kube/config --env KUBECONFIG=/kube/config \
-v $(PWD)/must-gather:/must-gather $(IMAGE_NAME_AND_VERSION):$(TAG)

Expand All @@ -36,4 +39,4 @@ IMAGE_NAME_AND_VERSION ?= $(REGISTRY)/$(IMG)

.PHONY: build-image
build-image:
$(CONTAINER_ENGINE) build --platform linux/amd64 -t $(IMAGE_NAME_AND_VERSION):$(TAG) -f build/Dockerfile
$(CONTAINER_ENGINE) build --platform linux/amd64 -t $(IMAGE_NAME_AND_VERSION):$(TAG) -f build/Dockerfile .
4 changes: 2 additions & 2 deletions build/Dockerfile.rhtap
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ COPY --from=builder /usr/bin/oc /usr/bin/oc
COPY --from=builder /usr/bin/yq /usr/bin/yq

# copy all collection scripts to /usr/bin
COPY collection-scripts/* /usr/bin/
COPY ./collection-scripts/* /usr/bin/

# Setup non-root user
COPY build/user_setup /usr/local/bin/
COPY ./build/user_setup /usr/local/bin/
RUN /usr/local/bin/user_setup
USER 1001

Expand Down

0 comments on commit 3f3fb2e

Please sign in to comment.