-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
42 lines (28 loc) · 1.53 KB
/
Dockerfile
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
37
38
39
40
41
FROM ghcr.io/jauderho/golang:1.23.3-alpine3.20@sha256:dce068d056966f5f51c72ce9e5c268d01fffdd1ecf92424a2646efaddf952c1b AS build
WORKDIR /go/src/github.com/likexian/whois/
ARG BUILD_VERSION
ARG ARCHIVE_URL=https://github.com/likexian/whois/archive/
ARG GIT_URL=https://github.com/likexian/whois.git
ENV CGO_ENABLED 0
RUN test -n "${BUILD_VERSION}" \
&& apk update \
&& apk upgrade -a \
&& apk add --no-cache git ca-certificates \
&& git clone --depth 1 ${GIT_URL} --branch ${BUILD_VERSION} /go/src/github.com/likexian/whois \
&& cd /go/src/github.com/likexian/whois \
&& go get -u all \
&& go build -o whois -v -trimpath -ldflags="-s -w" ./cmd/whois
WORKDIR /config
# ----------------------------------------------------------------------------
FROM scratch
#FROM alpine:3.17.2@sha256:69665d02cb32192e52e07644d76bc6f25abeb5410edc1c7a81a10ba3f0efb90a
LABEL org.opencontainers.image.authors="Jauder Ho <[email protected]>"
LABEL org.opencontainers.image.url="https://github.com/jauderho/dockerfiles"
LABEL org.opencontainers.image.documentation="https://github.com/jauderho/dockerfiles"
LABEL org.opencontainers.image.source="https://github.com/jauderho/dockerfiles"
LABEL org.opencontainers.image.title="jauderho/whois"
LABEL org.opencontainers.image.description="whois is a Go implementation of WHOIS with optional JSON output"
COPY --from=build /etc/ssl/certs /etc/ssl/certs
COPY --from=build /go/src/github.com/likexian/whois/whois /usr/local/bin/whois
COPY --from=build /config /config
ENTRYPOINT ["/usr/local/bin/whois"]