Added docker file to generate the image.
This commit is contained in:
parent
2a22708350
commit
7d46e3f7a6
|
@ -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" ]
|
Loading…
Reference in New Issue