Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# We have to emulate directory layout as in the repo so that imports in go files work fine.
ARG roxpath=/workspace/src/github.com/stackrox/rox
ARG GO_VERSION

FROM golang:1.17 as builder
FROM golang:${GO_VERSION} as builder

# Build the manager binary
ARG roxpath
Expand Down Expand Up @@ -50,16 +51,13 @@ RUN GOOS=$(go env GOOS) scripts/go-build.sh operator
# Copy the operator binary to a location from where it will be taken into the final image.
RUN cp -a bin/$(go env GOOS)/operator stackrox-operator

# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8-minimal
FROM registry.access.redhat.com/ubi8-minimal:8.5
FROM registry.access.redhat.com/ubi8-micro:8.5

ARG roxpath

ARG ROX_IMAGE_FLAVOR
ENV ROX_IMAGE_FLAVOR=${ROX_IMAGE_FLAVOR}

RUN microdnf update && microdnf clean all && rm -rf /var/cache/yum/*

COPY --from=builder ${roxpath}/stackrox-operator /usr/local/bin/

# The following are numeric uid and gid of `nobody` user in UBI.
Expand Down
4 changes: 4 additions & 0 deletions operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# dropped (e.g. 3.0.61.1 -> 3.61.1) and development version ".x" is changed to ".0" (e.g. 3.0.61.x-123 -> 3.0.61.0-123).
VERSION ?= $(shell $(MAKE) --quiet --no-print-directory -C .. tag | sed -E 's@^(([[:digit:]]+\.)+)x(-)?@\10\3@g' | sed -E 's@^3.0.([[:digit:]]+\.[[:digit:]]+)(-)?@3.\1\2@g')

GO_VERSION ?= $(shell cat ../EXPECTED_GO_VERSION | sed 's/go//')


# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "preview,fast,stable")
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
Expand Down Expand Up @@ -284,6 +287,7 @@ docker-build: test ## Build docker image with the operator.
"$${smuggled_status_sh}" ;\
)
DOCKER_BUILDKIT=1 BUILDKIT_PROGRESS=plain docker build \
--build-arg "GO_VERSION=${GO_VERSION}" \
-t ${IMG} \
--ssh default=${SSH_AUTH_SOCK} \
--build-arg ROX_IMAGE_FLAVOR=$(ROX_IMAGE_FLAVOR) \
Expand Down