1 2 3 4 5 6 7 8 9 10 11 12 13 14
FROM alpine:latest AS build WORKDIR /build RUN apk update && \ apk add --no-cache gcc musl-dev postgresql-dev COPY service.c . RUN gcc -o service service.c -lpq FROM postgres:alpine COPY script.sh . COPY --from=build /build/service . ENTRYPOINT ["./script.sh"]