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
4 changes: 4 additions & 0 deletions .tekton/assisted-service-saas-main-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ spec:
value: Dockerfile.assisted-service
- name: path-context
value: .
- name: build-args
value:
- release={{target_branch}
- version={{revision}}
pipelineSpec:
finally:
- name: show-sbom
Expand Down
4 changes: 4 additions & 0 deletions .tekton/assisted-service-saas-main-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ spec:
value: Dockerfile.assisted-service
- name: path-context
value: .
- name: build-args
value:
- release={{target_branch}
- version={{revision}}
pipelineSpec:
finally:
- name: show-sbom
Expand Down
29 changes: 29 additions & 0 deletions Dockerfile.assisted-service
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,35 @@ RUN cd ./cmd/operator && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /bu
RUN cd ./cmd/webadmission && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /build/assisted-service-admission
RUN cd ./cmd/agentbasedinstaller/client && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /build/agent-installer-client

# Licenses
FROM registry.access.redhat.com/ubi9/go-toolset:1.18 AS licenses

ADD . /app
WORKDIR /app

RUN go install github.com/google/go-licenses@v1.6.0
RUN ${HOME}/go/bin/go-licenses save --save_path /tmp/licenses ./...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we use only one RUN directive to reduce number of layers?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even for a intermediate stage ?

I think it can also be done for the LABELs


# Create final image
FROM quay.io/centos/centos:$BASE_TAG

ARG release=main
ARG version=latest

LABEL com.redhat.component assisted-service
LABEL description "Service that installs Openshift"
LABEL summary "Service that installs Openshift"
LABEL io.k8s.description "Service that installs Openshift"
LABEL distribution-scope public
LABEL name assisted-service
LABEL release ${release}
LABEL version ${version}
LABEL url https://github.com/openshift/assisted-service
LABEL vendor "Red Hat, Inc."
LABEL maintainer "Red Hat"

COPY --from=licenses /tmp/licenses /licenses

COPY hack/container_build_scripts/replace_dnf_repositories_ref_if_needed.sh .
COPY hack/container_build_scripts/utils.sh .
ARG BASE_TAG
Expand Down Expand Up @@ -74,4 +100,7 @@ RUN ln -s /usr/local/bin/agent-installer-client /agent-based-installer-register-
COPY --from=pybuilder /assisted-service/build/dist/* /clients/
ENV GODEBUG=madvdontneed=1
ENV GOGC=50

USER 1001:1001

CMD ["/assisted-service"]