Skip to content

Commit

Permalink
MGMT-17896: Add separate Dockerfile for assisted-service with an el8 …
Browse files Browse the repository at this point in the history
…base (#6347)

* Add separate Dockerfile for assisted-service with an el8 base

This is required to ensure that users have an option to install FIPS
clusters for versions where the installer is linked against el8 crypto
libraries.

The resulting image will be deployed by the operator when the user
indicates that clusters requiring the el8 libraries will be installed in
FIPS mode (versions < 4.16).

Resolves https://issues.redhat.com/browse/MGMT-17896

* Use a build arg to determine the base image

Instead of a separate Dockerfile for the el8 image an single build arg
will determine the base image.
  • Loading branch information
carbonin authored May 24, 2024
1 parent b1113ba commit 34706cf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Dockerfile.assisted-service
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG BASE_TAG=stream9

# Generate python client
FROM quay.io/edge-infrastructure/swagger-codegen-cli:2.4.18 as swagger_py
COPY swagger.yaml .
Expand All @@ -13,9 +15,11 @@ RUN cd /assisted-service/build && python3 ../tools/client_package_initializer.py
# TODO: Currently, the Python package is included in the service image for testing purposes. It conveniently allows matching a service version to a specific Python client version. In the future, once the Python package is published on pip, it should (probably) be removed from the Assisted Service image (this dockerfile).

# Build binaries
FROM quay.io/centos/centos:stream9 as builder
FROM quay.io/centos/centos:$BASE_TAG as builder

RUN dnf install --enablerepo=crb -y gcc git nmstate-devel && dnf clean all
COPY hack/container_build_scripts/install_build_deps.sh .
ARG BASE_TAG
RUN ./install_build_deps.sh $BASE_TAG
COPY --from=registry.ci.openshift.org/openshift/release:golang-1.20 /usr/local/go /usr/local/go

ENV GOROOT=/usr/local/go
Expand All @@ -39,7 +43,7 @@ RUN cd ./cmd/webadmission && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o
RUN cd ./cmd/agentbasedinstaller/client && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /build/agent-installer-client

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

# multiarch images need it till WRKLDS-222 and https://bugzilla.redhat.com/show_bug.cgi?id=2111537 are fixed
RUN dnf install -y --setopt=install_weak_deps=False skopeo
Expand Down
10 changes: 10 additions & 0 deletions hack/container_build_scripts/install_build_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

tag=${1}

repo=crb
if [ "$tag" = "stream8" ]; then
repo=powertools
fi

dnf install --enablerepo=$repo -y gcc git nmstate-devel && dnf clean all

0 comments on commit 34706cf

Please sign in to comment.