the-worlds-least-useful-clock/Dockerfile

25 lines
628 B
Docker

# syntax=docker/dockerfile:1
FROM alpine:latest as base
# Build Stage:
FROM base AS build
RUN apk add git build-base
RUN git clone https://undercroft.ocathain.ie/barra/the-worlds-least-useful-clock.git
RUN gcc the-worlds-least-useful-clock/the-worlds-least-useful-clock.c
# Final Stage:
FROM base AS final
COPY --from=build a.out /bin/useless-clock
ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser
USER appuser
COPY --from=build a.out /bin/useless-clock
ENTRYPOINT [ "/bin/useless-clock" ]