ifconfig/Dockerfile
2022-02-27 19:39:58 -05:00

39 lines
1.2 KiB
Docker

# 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
FROM casjaysdev/alpine:latest as run
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
ARG BUILD_DATE="$(date +'%Y-%m-%d %H:%M')"
LABEL \
org.label-schema.name="ifconfig" \
org.label-schema.description="Sow ip information" \
org.label-schema.url="https://github.com/casjaysdev/ifconfig" \
org.label-schema.vcs-url="https://github.com/casjaysdev/ifconfig" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.version=$BUILD_DATE \
org.label-schema.vcs-ref=$BUILD_DATE \
org.label-schema.license="MIT" \
org.label-schema.vcs-type="Git" \
org.label-schema.schema-version="1.0" \
org.label-schema.vendor="CasjaysDev" \
maintainer="CasjaysDev <docker-admin@casjaysdev.com>"
EXPOSE 8080
WORKDIR /opt/echoip
VOLUME /opt/echoip/html
HEALTHCHECK --start-period=1m --interval=10m --timeout=3s CMD ["/usr/local/bin/docker-entrypoint.sh", "healthcheck"]
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]