myos/docker/registrator/Dockerfile

40 lines
1.2 KiB
Docker
Raw Normal View History

2022-02-07 15:09:51 +01:00
FROM golang:1-alpine AS build
LABEL maintainer aynic.os <support+docker@asycn.io>
2021-02-09 17:05:00 +01:00
ARG DOCKER_BUILD_DIR
2021-06-13 02:09:57 +02:00
ARG GIT_AUTHOR_NAME
ARG GIT_AUTHOR_EMAIL
2021-02-09 17:05:00 +01:00
2021-06-13 02:09:57 +02:00
ENV GIT_AUTHOR_NAME=${GIT_AUTHOR_NAME}
ENV GIT_AUTHOR_EMAIL=${GIT_AUTHOR_EMAIL}
ENV GIT_COMMITTER_NAME=${GIT_AUTHOR_NAME}
ENV GIT_COMMITTER_EMAIL=${GIT_AUTHOR_EMAIL}
2021-02-09 17:05:00 +01:00
2022-06-04 02:24:35 +02:00
WORKDIR /go/src/github.com/auto1-oss/registrator/
2021-02-09 17:05:00 +01:00
RUN \
2022-06-04 02:24:35 +02:00
apk add --no-cache git \
&& git clone https://github.com/auto1-oss/registrator/ . \
&& git reset --hard 378a4ead31adfdae6550e112bfc186f1d1bed632 \
2022-02-07 15:09:51 +01:00
# -useIpFromNetwork \
2022-06-04 02:24:35 +02:00
&& git fetch origin pull/18/head \
&& git merge --no-edit 5ee80693b8057d92f261b87705445a1b989239ce \
2022-02-07 15:09:51 +01:00
# fix SERVICE_CHECK_SCRIPT
2022-06-04 02:24:35 +02:00
&& git fetch origin pull/19/head \
&& git merge --no-edit 9cfdfbee07dc6153af70f032eefc848af101fa7d \
2021-02-09 17:05:00 +01:00
&& CGO_ENABLED=0 GOOS=linux go build \
-a -installsuffix cgo \
-ldflags "-X main.Version=$(cat VERSION)" \
2022-02-07 15:09:51 +01:00
-o /go/bin/registrator \
2021-02-09 17:05:00 +01:00
.
2022-02-07 15:09:51 +01:00
FROM alpine:latest as dist
2021-02-09 17:05:00 +01:00
ARG DOCKER_BUILD_DIR
2022-02-07 15:09:51 +01:00
2021-02-09 17:05:00 +01:00
RUN apk add --no-cache ca-certificates
2022-02-07 15:09:51 +01:00
COPY --from=build /go/bin/registrator /bin/registrator
2021-02-09 17:05:00 +01:00
ENTRYPOINT ["/bin/registrator"]
2022-06-30 23:37:10 +02:00
HEALTHCHECK CMD kill -SIGUSR1 1
2021-02-09 17:05:00 +01:00
2021-06-13 02:09:57 +02:00
FROM dist as master
2021-02-09 17:05:00 +01:00
ARG DOCKER_BUILD_DIR