#
# stegtext release container file
#
# build command (note: prefer release.py):
#
# export VERSION=1.2.3 REVISION=$(git show-ref 1.2.3)
# podman build \
# -t stegtext:latest -t stegtext:"$VERSION" \
# -t codeberg.org/pablotron/stegtext:latest \
# -t codeberg.org/pablotron/stegtext:"$VERSION" \
# --build-arg VERSION="$VERSION" \
# --build-arg REVISION="$REVISION" \
# .
#
#
# build stage
#
FROM docker.io/rust AS build
COPY . /src
WORKDIR /src
# build static release binary
RUN ["rustup", "target", "add", "x86_64-unknown-linux-musl"]
RUN ["cargo", "build", "--release", "--target", "x86_64-unknown-linux-musl", "--bin", "stegtext"]
#
# run stage
#
FROM scratch
# build arguments
ARG VERSION REVISION
# ref: https://github.com/opencontainers/image-spec/blob/main/annotations.md
LABEL version="${VERSION}" description="Text steganography tool" \
org.opencontainers.image.url="https://codeberg.org/pablotron/stegtext" \
org.opencontainers.image.source="https://codeberg.org/pablotron/stegtext" \
org.opencontainers.image.documentation="https://codeberg.org/pablotron/stegtext" \
org.opencontainers.image.licenses="MIT-0" \
org.opencontainers.image.title="stegtext" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${REVISION}" \
org.opencontainers.image.description="Text steganography tool"
COPY --from=build /src/target/x86_64-unknown-linux-musl/release/stegtext /stegtext
ENTRYPOINT ["/stegtext"]