Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MGMT-17896: Add separate Dockerfile for assisted-service with an el8 base #6347

Merged
merged 2 commits into from
May 24, 2024
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
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