|
| 1 | +FROM registry.redhat.io/ubi9/go-toolset:1.23 AS builder |
| 2 | +COPY --chown=1001:0 . /workspace |
| 3 | +WORKDIR /workspace |
| 4 | + |
| 5 | +# FIX ME: need CI_VERSION and CI_KANTRA_UPSTREAM_COMMIT |
| 6 | +RUN CGO_ENABLED=0 GOOS=linux GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime \ |
| 7 | +--ldflags="-X 'github.com/konveyor-ecosystem/kantra/cmd.Version=$CI_VERSION' \ |
| 8 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.RunnerImage=registry.redhat.io/mta/mta-cli-rhel9:$CI_VERSION' \ |
| 9 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.JavaBundlesLocation=/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core.jar' \ |
| 10 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.JavaProviderImage=registry.redhat.io/mta/mta-java-external-provider-rhel9:$CI_VERSION' \ |
| 11 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.DotnetProviderImage=registry.redhat.io/mta/mta-dotnet-external-provider-rhel9:$CI_VERSION' \ |
| 12 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.GenericProviderImage=registry.redhat.io/mta/mta-generic-external-provider-rhel9:$CI_VERSION' \ |
| 13 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.RootCommandName=mta-cli' \ |
| 14 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.BuildCommit=$CI_KANTRA_UPSTREAM_COMMIT'" \ |
| 15 | + -a -o mta-cli main.go |
| 16 | +RUN CGO_ENABLED=0 GOOS=darwin go build \ |
| 17 | +--ldflags="-X 'github.com/konveyor-ecosystem/kantra/cmd.Version=$CI_VERSION' \ |
| 18 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.RunnerImage=registry.redhat.io/mta/mta-cli-rhel9:$CI_VERSION' \ |
| 19 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.JavaBundlesLocation=/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core.jar' \ |
| 20 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.JavaProviderImage=registry.redhat.io/mta/mta-java-external-provider-rhel9:$CI_VERSION' \ |
| 21 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.DotnetProviderImage=registry.redhat.io/mta/mta-dotnet-external-provider-rhel9:$CI_VERSION' \ |
| 22 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.GenericProviderImage=registry.redhat.io/mta/mta-generic-external-provider-rhel9:$CI_VERSION' \ |
| 23 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.RootCommandName=mta-cli' \ |
| 24 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.BuildCommit=$CI_KANTRA_UPSTREAM_COMMIT'" \ |
| 25 | + -a -o darwin-mta-cli main.go |
| 26 | +RUN CGO_ENABLED=0 GOOS=windows go build \ |
| 27 | +--ldflags="-X 'github.com/konveyor-ecosystem/kantra/cmd.Version=$CI_VERSION' \ |
| 28 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.RunnerImage=registry.redhat.io/mta/mta-cli-rhel9:$CI_VERSION' \ |
| 29 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.JavaBundlesLocation=/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core.jar' \ |
| 30 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.JavaProviderImage=registry.redhat.io/mta/mta-java-external-provider-rhel9:$CI_VERSION' \ |
| 31 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.DotnetProviderImage=registry.redhat.io/mta/mta-dotnet-external-provider-rhel9:$CI_VERSION' \ |
| 32 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.GenericProviderImage=registry.redhat.io/mta/mta-generic-external-provider-rhel9:$CI_VERSION' \ |
| 33 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.RootCommandName=mta-cli' \ |
| 34 | +-X 'github.com/konveyor-ecosystem/kantra/cmd.BuildCommit=$CI_KANTRA_UPSTREAM_COMMIT'" \ |
| 35 | + -a -o windows-mta-cli.exe main.go |
| 36 | + |
| 37 | +FROM registry.redhat.io/ubi9:latest AS rulesets |
| 38 | +COPY --chown=1001:0 . /workspace |
| 39 | + |
| 40 | +FROM brew.registry.redhat.io/rh-osbs/mta-mta-static-report-rhel9:8.0.0 as static-report |
| 41 | + |
| 42 | +FROM brew.registry.redhat.io/rh-osbs/mta-mta-analyzer-lsp-rhel9:8.0.0 |
| 43 | +RUN dnf -y install podman && dnf -y clean all |
| 44 | + |
| 45 | +RUN echo mta:x:1000:0:1000 user:/home/mta:/sbin/nologin > /etc/passwd |
| 46 | +RUN echo mta:10000:5000 > /etc/subuid |
| 47 | +RUN echo mta:10000:5000 > /etc/subgid |
| 48 | +RUN mkdir -p /home/mta/.config/containers/ |
| 49 | +RUN cp /etc/containers/storage.conf /home/mta/.config/containers/storage.conf |
| 50 | +RUN sed -i "s/^driver.*/driver = \"vfs\"/g" /home/mta/.config/containers/storage.conf |
| 51 | +RUN echo -ne '[containers]\nvolumes = ["/proc:/proc",]\ndefault_sysctls = []' > /home/mta/.config/containers/containers.conf |
| 52 | +RUN chown -R 1000:1000 /home/mta |
| 53 | + |
| 54 | +RUN mkdir -p /opt/rulesets /opt/rulesets/input /opt/rulesets/convert /opt/openrewrite /opt/input /opt/input/rules /opt/input/rules/custom /opt/output /tmp/source-app /tmp/source-app/input |
| 55 | + |
| 56 | +COPY --from=builder /workspace/mta-cli /usr/local/bin/mta-cli |
| 57 | +COPY --from=builder /workspace/darwin-mta-cli /usr/local/bin/darwin-mta-cli |
| 58 | +COPY --from=builder /workspace/windows-mta-cli.exe /usr/local/bin/windows-mta-cli.exe |
| 59 | +COPY --from=rulesets /workspace/hack/build/rulesets/default/generated /opt/rulesets |
| 60 | +COPY --from=rulesets /workspace/hack/build/windup-rulesets/rules/rules-reviewed/openrewrite /opt/openrewrite |
| 61 | +COPY --from=static-report /usr/bin/js-bundle-generator /usr/local/bin/js-bundle-generator |
| 62 | +COPY --from=static-report /usr/local/static-report /usr/local/static-report |
| 63 | +COPY --from=builder --chmod=755 /workspace/entrypoint.sh /usr/bin/entrypoint.sh |
| 64 | +COPY --from=builder --chmod=755 /workspace/openrewrite_entrypoint.sh /usr/bin/openrewrite_entrypoint.sh |
| 65 | +COPY --from=builder /workspace/LICENSE /licenses/ |
| 66 | + |
| 67 | +RUN find /opt/rulesets/azure -type f -exec sed -i '/konveyor.io\/target=azure-aks/d' {} + |
| 68 | +RUN find /opt/rulesets/azure -type f -exec sed -i '/konveyor.io\/target=azure-container-apps/d' {} + |
| 69 | + |
| 70 | +ENTRYPOINT ["mta-cli"] |
| 71 | + |
| 72 | +LABEL \ |
| 73 | + description="Migration Toolkit for Applications - CLI" \ |
| 74 | + io.k8s.description="Migration Toolkit for Applications - CLI" \ |
| 75 | + io.k8s.display-name="MTA - CLI" \ |
| 76 | + io.openshift.maintainer.project="MTA" \ |
| 77 | + io.openshift.tags="migration,modernization,mta,tackle,konveyor" \ |
| 78 | + summary="Migration Toolkit for Applications - CLI" |
0 commit comments