forked from freudenreichan/EinfuehrungInDocker_Pipeline2
27 lines
514 B
Docker
27 lines
514 B
Docker
|
|
FROM alpine:latest AS builder
|
|
|
|
RUN apk add --no-cache build-base
|
|
|
|
WORKDIR /build
|
|
COPY deployment.c .
|
|
|
|
|
|
RUN gcc -static -o deployment deployment.c
|
|
|
|
FROM alpine:latest
|
|
|
|
WORKDIR /app
|
|
COPY --from=builder /build/deployment .
|
|
|
|
RUN adduser -D appuser && \
|
|
mkdir /output && \
|
|
chown -R appuser:appuser /app /output
|
|
|
|
USER appuser
|
|
|
|
VOLUME /output
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s CMD test -f /output/output.txt || exit 1
|
|
|
|
CMD ["sh", "-c", "./deployment 10 > /output/output.txt && tail -f /output/output.txt"] |