forked from hageltech/cert-manager-webhook-oci
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
30 lines (23 loc) · 825 Bytes
/
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
ARG ORACLE_LINUX_VERSION=7.9
FROM oraclelinux:${ORACLE_LINUX_VERSION} AS oracle-linux-go-dev
ARG GOLANG_VERSION="1.19-1.0.1.el7"
RUN yum update -y \
&& yum install -y oracle-golang-release-el7 git \
&& yum install -y golang-${GOLANG_VERSION}
########################################################
FROM oracle-linux-go-dev AS build_deps
WORKDIR /workspace
ENV GO111MODULE=on
COPY go.mod .
COPY go.sum .
RUN go mod download
########################################################
FROM build_deps AS build
WORKDIR /workspace
ENV GO111MODULE=on
COPY . .
RUN CGO_ENABLED=0 go build -o webhook -ldflags '-w -extldflags "-static"' .
########################################################
FROM oraclelinux:${ORACLE_LINUX_VERSION}
COPY --from=build /workspace/webhook /usr/local/bin/webhook
ENTRYPOINT ["webhook"]