Skip to content

Commit

Permalink
🌱 If seed dir exists on the filesystem, don't clone it in the dockerf…
Browse files Browse the repository at this point in the history
…ile (konveyor#576)

This was the simplest way to do it I think, without requiring Makefile
updates to pass along build-args and dealing with various values. If you
just drop tackle2-seed into the project it won't clone it anymore.

Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
  • Loading branch information
fabianvf authored Dec 13, 2023
1 parent 711f94a commit b59c2c7
Showing 1 changed file with 7 additions and 2 deletions.
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

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

0 comments on commit b59c2c7

Please sign in to comment.