Added docker file to generate the image.

This commit is contained in:
Barra Ó Catháin 2024-04-18 16:01:05 +01:00
parent 2a22708350
commit 7d46e3f7a6
1 changed files with 24 additions and 0 deletions

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
# 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" ]