Skip to content
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

🌱 If seed dir exists on the filesystem, don't clone it in the dockerfile #576

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
ARG SEED_ROOT=/opt/app-root/src/tackle2-seed
FROM registry.access.redhat.com/ubi9/go-toolset:latest as builder
ENV GOPATH=$APP_ROOT
COPY --chown=1001:0 . .
RUN make docker
ARG SEED_PROJECT=konveyor/tackle2-seed
ARG SEED_BRANCH=main
RUN git clone --branch ${SEED_BRANCH} https://github.com/${SEED_PROJECT}
ARG SEED_ROOT
RUN if [ ! -d "${SEED_ROOT}" ]; then \
git clone --branch ${SEED_BRANCH} https://github.com/${SEED_PROJECT} ${SEED_ROOT}; \
fi
Copy link
Contributor

@jortel jortel Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a var for the seed root directory would be better to ensure it's the same everywhere.
Like:

ARG SEED_ROOT=/opt/app-root/src/tackle2-seed
RUN if [ ! -d "${SEED_ROOT}" ]; then \
      git clone --branch ${SEED_BRANCH} https://github.com/${SEED_PROJECT} ${SEED_ROOT}; \
    fi

Then below:

COPY --from=builder ${SEED_ROOT}/resources/ /tmp/seed


FROM quay.io/konveyor/static-report as report

FROM registry.access.redhat.com/ubi9/ubi-minimal
ARG SEED_ROOT
COPY --from=builder /opt/app-root/src/bin/hub /usr/local/bin/tackle-hub
COPY --from=builder /opt/app-root/src/auth/roles.yaml /tmp/roles.yaml
COPY --from=builder /opt/app-root/src/auth/users.yaml /tmp/users.yaml
COPY --from=builder /opt/app-root/src/tackle2-seed/resources/ /tmp/seed
COPY --from=builder ${SEED_ROOT}/resources/ /tmp/seed
COPY --from=report /usr/local/static-report /tmp/analysis/report

RUN microdnf -y install \
Expand Down
Loading