shellspec/shellspec

View on GitHub
.dockerhub/Dockerfile.scratch

Summary

Maintainability
Test Coverage
# ======================================================================
# source code
# ======================================================================
FROM scratch as source
COPY shellspec LICENSE /opt/shellspec/
COPY lib /opt/shellspec/lib
COPY libexec /opt/shellspec/libexec

# ======================================================================
# Fake kcov target to pass the test
# ======================================================================
FROM busybox as kcov
RUN echo "#!/bin/true" > /bin/sh

# ======================================================================
# Use standard target to test source code
# ======================================================================
FROM alpine as standard
ENV PATH /opt/shellspec/:$PATH
COPY --from=source /opt/shellspec /opt/shellspec

# ======================================================================
# Source image (default)
#   TAG: shellspec-scratch:latest, shellspec-scratch:[VERSION]
# ======================================================================
FROM scratch
COPY --from=source /opt/shellspec /opt/shellspec
ARG CREATED
ARG AUTHORS
ARG VERSION
ARG REVISION
ARG REFNAME
LABEL org.opencontainers.image.created=$CREATED \
      org.opencontainers.image.authors=$AUTHORS \
      org.opencontainers.image.url="https://shellspec.info/" \
      org.opencontainers.image.documentation="https://github.com/shellspec/shellspec" \
      org.opencontainers.image.source="https://github.com/shellspec/shellspec.git" \
      org.opencontainers.image.version=$VERSION \
      org.opencontainers.image.revision=$REVISION \
      org.opencontainers.image.vendor="shellspec" \
      org.opencontainers.image.licenses="MIT" \
      org.opencontainers.image.ref.name=$REFNAME \
      org.opencontainers.image.title="shellspec-scratch" \
      org.opencontainers.image.description="Shellspec (Scratch based)"