Skip to content

Commit

Permalink
Containerize tunnel (#3646)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsatam authored Jul 10, 2024
1 parent 0017517 commit 2eb19ec
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Dockerfile.ci-tunnel
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ARG REGISTRY
ARG ARO_VERSION

FROM ${REGISTRY}/ubi8/go-toolset:1.20.12-5 AS builder
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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ ci-rp: fix-macos-vendor
docker build . -f Dockerfile.ci-rp --ulimit=nofile=4096:4096 --build-arg REGISTRY=$(REGISTRY) --build-arg ARO_VERSION=$(VERSION) --target builder --cache-from $(ARO_PORTAL_BUILD_IMAGE) -t $(ARO_BUILDER_IMAGE)
docker build . -f Dockerfile.ci-rp --ulimit=nofile=4096:4096 --build-arg REGISTRY=$(REGISTRY) --build-arg ARO_VERSION=$(VERSION) --cache-from $(ARO_BUILDER_IMAGE) -t $(ARO_IMAGE)

.PHONY: ci-tunnel
ci-tunnel: fix-macos-vendor
docker build . -f Dockerfile.ci-tunnel --ulimit=nofile=4096:4096 --build-arg REGISTRY=$(REGISTRY) --build-arg ARO_VERSION=$(VERSION) --no-cache=$(NO_CACHE) -t aro-tunnel:$(VERSION)

.PHONY: ci-clean
ci-clean:
docker image prune --all --filter="label=aro-*=true"
Expand Down

0 comments on commit 2eb19ec

Please sign in to comment.