-
Notifications
You must be signed in to change notification settings - Fork 26
/
Containerfile.apiserver
46 lines (39 loc) · 1.13 KB
/
Containerfile.apiserver
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
42
43
44
45
46
FROM registry.access.redhat.com/ubi8/ubi as build
RUN if [ ! -d /usr/local/go ] ; then \
[[ $(uname -p) = "x86_64" ]] && ARCH="amd64" || ARCH="arm64" ; \
v=1.22.1; \
curl -sL https://go.dev/dl/go${v}.linux-${ARCH}.tar.gz -o /tmp/go.tgz; \
tar -C /usr/local -xzf /tmp/go.tgz; \
mkdir -p /go/bin; \
mkdir -p /go/src; \
fi
ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOPATH="/go"
RUN dnf update -qy && \
dnf install --setopt=install_weak_deps=False -qy \
make \
gcc \
git \
glibc-devel \
&& \
dnf clean all -y &&\
rm -rf /var/cache/yum
RUN go install github.com/go-delve/delve/cmd/dlv@latest
ARG BUILD_PROFILE=dev
ARG NEXODUS_PPROF=
ARG NEXODUS_RACE_DETECTOR=
WORKDIR /src
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN NOISY_BUILD=y \
NEXODUS_RACE_DETECTOR=${NEXODUS_RACE_DETECTOR} \
NEXODUS_PPROF=${NEXODUS_PPROF} \
NEXODUS_BUILD_PROFILE=$BUILD_PROFILE \
make dist/apiserver
FROM registry.access.redhat.com/ubi8/ubi
COPY --from=build /src/dist/apiserver /apiserver
COPY --chmod=755 --from=build /go/bin/dlv /dlv
EXPOSE 8080
CMD ["/apiserver"]