-
Notifications
You must be signed in to change notification settings - Fork 43
add template konflux dockerfile #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: oadp-dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.25 AS builder | ||
| COPY . . | ||
| COPY go.mod go.sum $APP_ROOT/src/github.com/konveyor/openshift-velero-plugin/ | ||
| RUN go mod download | ||
| COPY . $APP_ROOT/src/github.com/konveyor/openshift-velero-plugin | ||
| WORKDIR $APP_ROOT/src/github.com/konveyor/openshift-velero-plugin | ||
| ENV GOPATH=$APP_ROOT | ||
| ENV BUILDTAGS containers_image_ostree_stub exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp exclude_graphdriver_overlay include_gcs include_oss strictfipsruntime | ||
| ENV BIN velero-plugins | ||
| ENV GOEXPERIMENT strictfipsruntime | ||
| RUN go build -installsuffix "static" -tags "$BUILDTAGS" -mod=mod -o _output/$BIN ./$BIN | ||
|
|
||
|
|
||
| FROM registry.redhat.io/ubi9/ubi:latest | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Verify whether floating base tags are present in Dockerfiles.
rg -n '^\s*FROM\s+\S+:latest(\s|$)' --glob '*Dockerfile*'Repository: openshift/openshift-velero-plugin Length of output: 138 Use explicit version tags instead of Floating tags like 🤖 Prompt for AI Agents |
||
| RUN dnf -y install openssl && dnf -y reinstall tzdata && dnf clean all | ||
| RUN mkdir /plugins | ||
| COPY --from=builder $APP_ROOT/src/github.com/konveyor/openshift-velero-plugin/_output/$BIN /plugins/ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show variable usage and stage-local declarations around runtime stage.
nl -ba konflux.Dockerfile | sed -n '1,26p'
echo
echo "Runtime-stage ENV/ARG declarations:"
awk '
BEGIN {stage=0}
/^\s*FROM\s+/ {stage++; next}
stage==2 && /^\s*(ENV|ARG)\s+/ {print NR ":" $0}
' konflux.Dockerfile
echo
echo "Variable references in COPY --from lines:"
rg -n '^\s*COPY\s+--from=.*\$(APP_ROOT|BIN)' konflux.DockerfileRepository: openshift/openshift-velero-plugin Length of output: 119 🏁 Script executed: #!/bin/bash
# Read the Dockerfile to understand its structure and variable usage
cat -n konflux.DockerfileRepository: openshift/openshift-velero-plugin Length of output: 1581
Add the following to the runtime stage: FROM registry.redhat.io/ubi9/ubi:latest
+ENV APP_ROOT=/opt/app-root
+ENV BIN=velero-plugins
RUN dnf -y install openssl && dnf -y reinstall tzdata && dnf clean all🤖 Prompt for AI Agents |
||
| COPY LICENSE /licenses/ | ||
| USER 65534:65534 | ||
| ENTRYPOINT ["/bin/bash", "-c", "cp /plugins/* /target/."] | ||
|
|
||
| LABEL description="OpenShift API for Data Protection - Velero Plugin" | ||
| LABEL io.k8s.description="OpenShift API for Data Protection - Velero Plugin" | ||
| LABEL io.k8s.display-name="OADP Velero Plugin" | ||
| LABEL io.openshift.tags="migration" | ||
| LABEL summary="OpenShift API for Data Protection - Velero Plugin" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependency layer caching is currently defeated.
COPY . .beforego mod downloadcauses dependency downloads to rerun on any source change, and the full source is copied twice.Proposed fix
As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
🤖 Prompt for AI Agents