2024-07-10 21:58:46 +03:00
|
|
|
ARG REGISTRY
|
|
|
|
ARG ARO_VERSION
|
|
|
|
|
2024-07-18 10:35:06 +03:00
|
|
|
FROM ${REGISTRY}/ubi8/go-toolset:1.21.11-1.1720406008 AS builder
|
2024-07-10 21:58:46 +03:00
|
|
|
ARG ARO_VERSION
|
|
|
|
USER root
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# golang config and build steps
|
|
|
|
ENV GOPATH=/root/go
|
|
|
|
|
|
|
|
# Copy dependencies and source files
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
COPY vendor vendor
|
|
|
|
COPY hack hack
|
|
|
|
COPY pkg pkg
|
|
|
|
|
|
|
|
# build
|
|
|
|
RUN go build -ldflags "-X github.com/Azure/ARO-RP/pkg/util/version.GitCommit=${ARO_VERSION}" ./hack/tunnel
|
|
|
|
|
|
|
|
FROM ${REGISTRY}/ubi8/ubi-minimal AS final
|
|
|
|
RUN microdnf update && microdnf clean all
|
|
|
|
COPY --from=builder /app/tunnel /usr/local/bin/
|
|
|
|
ENTRYPOINT ["tunnel"]
|
|
|
|
EXPOSE 8443/tcp
|
|
|
|
USER 1000
|