forked from openshift/tls-scanner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.local
More file actions
38 lines (26 loc) · 1.34 KB
/
Dockerfile.local
File metadata and controls
38 lines (26 loc) · 1.34 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
37
38
FROM --platform=$BUILDPLATFORM golang:1.24 AS builder
ARG TARGETOS=linux
ARG TARGETARCH=amd64
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . ./
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -mod=readonly -ldflags="-s -w" -o bin/tls-scanner ./cmd/tls-scanner
FROM registry.access.redhat.com/ubi9/ubi:latest
ARG OC_VERSION=latest
ARG TARGETARCH=amd64
ARG TESTSSL_VERSION=3.2.2
RUN dnf -y update && \
dnf install -y --allowerasing binutils file jq tar lsof openssl bash wget procps-ng hostname bind-utils net-tools coreutils socat && \
dnf clean all
RUN wget -O "openshift-client-linux-${OC_VERSION}.tar.gz" "https://mirror.openshift.com/pub/openshift-v4/${TARGETARCH}/clients/ocp/${OC_VERSION}/openshift-client-linux.tar.gz" && \
tar -C /usr/local/bin -xzvf "openshift-client-linux-$OC_VERSION.tar.gz" oc && \
rm -f "openshift-client-linux-$OC_VERSION.tar.gz"
RUN curl -L "https://testssl.sh/testssl.sh-${TESTSSL_VERSION}.tar.gz" -o /tmp/testssl.tar.gz && \
mkdir -p /opt/testssl && \
tar -xzf /tmp/testssl.tar.gz -C /opt/testssl --strip-components=1 && \
chmod +x /opt/testssl/testssl.sh && \
ln -s /opt/testssl/testssl.sh /usr/local/bin/testssl.sh && \
rm -f /tmp/testssl.tar.gz
COPY --from=builder /app/bin/tls-scanner /usr/local/bin/tls-scanner
ENTRYPOINT ["/usr/local/bin/tls-scanner"]