2022-02-14 16:45:10 -05:00
|
|
|
# Build
|
|
|
|
FROM golang:1.15-buster AS build
|
|
|
|
WORKDIR /go/src/github.com/mpolden/echoip
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Must build without cgo because libc is unavailable in runtime image
|
|
|
|
ENV GO111MODULE=on CGO_ENABLED=0
|
|
|
|
RUN make
|
|
|
|
|
|
|
|
# Run
|
2022-07-09 13:22:52 -04:00
|
|
|
FROM casjaysdevdocker/alpine:latest as run
|
2022-02-14 16:45:10 -05:00
|
|
|
COPY --from=build /go/bin/echoip /opt/echoip/
|
|
|
|
COPY ./html /opt/echoip/html
|
|
|
|
COPY ./bin/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
|
|
|
|
|
|
FROM run
|
2022-10-07 18:47:30 -04:00
|
|
|
ARG BUILD_DATE="$(date +'%Y-%m-%d %H:%M')"
|
2022-02-14 16:45:10 -05:00
|
|
|
|
|
|
|
LABEL \
|
|
|
|
org.label-schema.name="ifconfig" \
|
|
|
|
org.label-schema.description="Sow ip information" \
|
2022-07-09 13:22:52 -04:00
|
|
|
org.label-schema.url="https://hub.docker.com/r/casjaysdevdocker/ifconfig" \
|
|
|
|
org.label-schema.vcs-url="https://github.com/casjaysdevdocker/ifconfig" \
|
2022-02-14 16:45:10 -05:00
|
|
|
org.label-schema.build-date=$BUILD_DATE \
|
|
|
|
org.label-schema.version=$BUILD_DATE \
|
|
|
|
org.label-schema.vcs-ref=$BUILD_DATE \
|
2022-07-09 13:22:52 -04:00
|
|
|
org.label-schema.license="WTFPL" \
|
2022-02-14 16:45:10 -05:00
|
|
|
org.label-schema.vcs-type="Git" \
|
|
|
|
org.label-schema.schema-version="1.0" \
|
|
|
|
org.label-schema.vendor="CasjaysDev" \
|
2022-10-07 18:47:30 -04:00
|
|
|
maintainer="CasjaysDev <docker-admin@casjaysdev.com>"
|
2022-02-14 16:45:10 -05:00
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
WORKDIR /opt/echoip
|
|
|
|
VOLUME /opt/echoip/html
|
|
|
|
|
2022-02-27 19:39:58 -05:00
|
|
|
HEALTHCHECK --start-period=1m --interval=10m --timeout=3s CMD ["/usr/local/bin/docker-entrypoint.sh", "healthcheck"]
|
2022-02-14 16:45:10 -05:00
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|