##################################################
# Notes for GitHub Actions
# * Dockerfile instructions: https://git.io/JfGwP
# * Environment variables: https://git.io/JfGw5
##################################################
#########################
# STAGE: GLOBAL
# Description: Global args for reuse
#########################
ARG VERSION="0"
#########################
# STAGE: BUILD
# Description: Build the app
#########################
FROM rust:1.44.0 as BUILD
ARG VERSION
WORKDIR /
ADD . /
RUN cargo build --release
#########################
# STAGE: RUN
# Description: Run the app
#########################
FROM gcr.io/distroless/cc as RUN
ARG VERSION
LABEL name="pipeprogress" \
maintainer="MAHDTech <MAHDTech@saltlabs.dev>" \
vendor="Salt Labs" \
version="${VERSION}" \
summary="Displays progress for pipe operations" \
url="https://github.com/salt-labs/pipeprogress"
WORKDIR /
COPY --from=BUILD /target/release/pp /
COPY "LICENSE" "README.md" /
ENTRYPOINT [ "./pp" ]
CMD [ "--help" ]