forked from bavix/gripmock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
36 lines (25 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM golang:1.24-alpine3.21 AS builder
ARG version
COPY . /gripmock-src
WORKDIR /gripmock-src
#hadolint ignore=DL3018
RUN apk add --no-cache binutils \
&& go build -o /usr/local/bin/gripmock -ldflags "-X 'github.com/bavix/gripmock/v3/cmd.version=${version:-dev}' -s -w" . \
&& strip /usr/local/bin/gripmock \
&& apk del binutils \
&& rm -rf /root/.cache /go/pkg /tmp/* /var/cache/*
RUN chmod +x /gripmock-src/entrypoint.sh && chmod +x /usr/local/bin/gripmock
FROM alpine:3.21
LABEL org.opencontainers.image.title="GripMock"
LABEL org.opencontainers.image.description="Mock server for gRPC services with dynamic stubbing capabilities"
LABEL org.opencontainers.image.source="https://github.com/bavix/gripmock"
LABEL org.opencontainers.image.documentation="https://bavix.github.io/gripmock/"
LABEL org.opencontainers.image.authors="Babichev Maksim <info@babichev.net>"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.vendor="bavix"
COPY --from=builder /usr/local/bin/gripmock /usr/local/bin/gripmock
COPY --from=builder /gripmock-src/entrypoint.sh /entrypoint.sh
EXPOSE 4770 4771
HEALTHCHECK --start-interval=1s --start-period=30s \
CMD gripmock check --silent
ENTRYPOINT ["/entrypoint.sh"]