FROM alpine/git:latest as git
#
# Test Data 1: A Git Repository
#
RUN mkdir /test && \
cd /test && \
git config --global user.name "John Doe" && \
git config --global user.email johndoe@example.com && \
git init . && \
echo "test" > README.md && \
git add . && \
git commit -m "test"
FROM rust:1.71.0
# use '/test.git' as target, to provide a valid Git URL
COPY --from=git /test /test.git
WORKDIR /usr/src/app
ENTRYPOINT [ "cargo", "test" ]