Skip to content

Commit 51488d6

Browse files
Merge pull request #176 from openshift/make-docker-consistent
NO-JIRA: chore: make dockerfile consistent with konflux, add make podman-cross-build command
2 parents 4743730 + a193c6c commit 51488d6

2 files changed

Lines changed: 28 additions & 11 deletions

File tree

Dockerfile.dev

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# This Dockerfile is used for local testing of images. All images should be available for public use
2-
FROM registry.access.redhat.com/ubi9/nodejs-22:latest AS web-builder
1+
FROM registry.redhat.io/ubi9/nodejs-22:latest AS web-builder
32

43
WORKDIR /opt/app-root
54

65
USER 0
76

7+
ENV HUSKY=0
88
COPY web/package*.json web/
99
COPY Makefile Makefile
10-
RUN make install-frontend
10+
RUN make install-frontend-ci
1111

1212
COPY web/ web/
1313
RUN make build-frontend
@@ -20,14 +20,23 @@ COPY Makefile Makefile
2020
COPY go.mod go.mod
2121
COPY go.sum go.sum
2222

23-
RUN go mod download
23+
RUN make install-backend
2424

2525
COPY cmd/ cmd/
2626
COPY pkg/ pkg/
2727

28-
RUN make build-backend
28+
ENV GOFLAGS='-mod=mod'
29+
ENV GOEXPERIMENT=strictfipsruntime
30+
ENV CGO_ENABLED=1
2931

30-
FROM registry.access.redhat.com/ubi9/ubi-minimal
32+
RUN make build-backend BUILD_OPTS="-tags strictfipsruntime"
33+
34+
FROM registry.redhat.io/rhel9-4-els/rhel:9.4
35+
36+
RUN mkdir /licenses
37+
COPY LICENSE /licenses/.
38+
39+
USER 1001
3140

3241
COPY --from=web-builder /opt/app-root/web/dist /opt/app-root/web/dist
3342
COPY --from=go-builder /opt/app-root/plugin-backend /opt/app-root

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2+
VERSION ?= latest
3+
PLATFORMS ?= linux/arm64,linux/amd64
4+
ORG ?= openshift-observability-ui
5+
IMAGE ?= quay.io/${ORG}/troubleshooting-panel-console-plugin:${VERSION}
6+
17
.PHONY: test
28
test: test-frontend
39

@@ -56,15 +62,11 @@ build-image: build-frontend test-frontend
5662
start-forward:
5763
./scripts/start-forward.sh
5864

59-
export REGISTRY_ORG?= openshift-observability-ui
60-
export TAG?=latest
61-
IMAGE=quay.io/${REGISTRY_ORG}/troubleshooting-panel-console-plugin:${TAG}
62-
6365
.PHONY: deploy
6466
deploy: test-frontend ## Build and push image, reinstall on cluster using helm.
6567
helm uninstall troubleshooting-panel-console-plugin -n troubleshooting-panel-console-plugin || true
6668
PUSH=1 scripts/build-image.sh
67-
helm install troubleshooting-panel-console-plugin charts/openshift-console-plugin -n troubleshooting-panel-console-plugin --create-namespace --set plugin.image=$(IMAGE)
69+
helm install troubleshooting-panel-console-plugin charts/openshift-console-plugin -n troubleshooting-panel-console-plugin --create-namespace --set plugin.image=${IMAGE}
6870

6971
.PHONY: start-devspace-backend
7072
start-devspace-backend:
@@ -77,3 +79,9 @@ gen-client: web/src/korrel8r/client
7779
web/src/korrel8r/client: korrel8r/swagger.json
7880
cd web && npx openapi-typescript-codegen --indent 2 --input ../$< --output ../$@ --name Korrel8rClient
7981
@touch $@
82+
83+
.PHONY: podman-cross-build
84+
podman-cross-build:
85+
podman manifest create -a ${IMAGE}
86+
podman build --platform=${PLATFORMS} --manifest ${IMAGE} -f Dockerfile.dev
87+
podman manifest push ${IMAGE}

0 commit comments

Comments
 (0)