-
Notifications
You must be signed in to change notification settings - Fork 83
/
Dockerfile.assisted_installer_agent-mce
63 lines (52 loc) · 2.52 KB
/
Dockerfile.assisted_installer_agent-mce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/go-toolset:1.21 AS builder
ARG TARGETPLATFORM
ENV USER_UID=1001 \
USER_NAME=assisted-installer
ENV COMPONENT_NAME=assisted-installer-agent
ENV COMPONENT_VERSION=1.0.0
ENV COMPONENT_TAG_EXTENSION=" "
ENV GOFLAGS="-p=4"
ENV GOEXPERIMENT=strictfipsruntime
ENV BUILD_TAGS="strictfipsruntime"
COPY --chown=${USER_UID} . /app
WORKDIR /app
RUN go install github.com/google/[email protected]
RUN ${HOME}/go/bin/go-licenses save --save_path /tmp/licenses ./...
RUN CGO_FLAG=1 make build
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/ubi:9.4
ARG release=main
ARG version=latest
RUN PKGS="findutils iputils podman ipmitool file sg3_utils fio nmap dhclient tar openssh-clients chrony util-linux hwdata" && \
X86_PKGS=$(if [ "$(uname -m)" == "x86_64" ]; then echo -n biosdevname dmidecode ; fi) && \
ARM_PKGS=$(if [ "$(uname -m)" == "aarch64" ]; then echo -n dmidecode ; fi) && \
PPC64LE_PKGS=$(if [ "$(uname -m)" == "ppc64le" ]; then echo -n '' ; fi) && \
S390X_PKGS=$(if [ "$(uname -m)" == "s390x" ]; then echo -n '' ; fi) && \
subscription-manager refresh && \
dnf install -y $PKGS $X86_PKGS $ARM_PKGS $PPC64LE_PKGS $S390X_PKGS && \
dnf update -y systemd && \
dnf clean all && \
rm -rf /var/cache/{yum,dnf}/*
COPY --from=builder /tmp/licenses /licenses
COPY --from=builder /app/build/agent /usr/bin/agent
# The step binaries are all symlinks to /usr/bin/agent
RUN ln -s /usr/bin/agent /usr/bin/free_addresses && \
ln -s /usr/bin/agent /usr/bin/inventory && \
ln -s /usr/bin/agent /usr/bin/logs_sender && \
ln -s /usr/bin/agent /usr/bin/next_step_runner && \
ln -s /usr/bin/agent /usr/bin/disk_speed_check
LABEL com.redhat.component="multicluster-engine-assisted-installer-agent-container" \
name="multicluster-engine/assisted-installer-agent-rhel9" \
version="${version}" \
upstream-ref="${version}" \
upstream-url="https://github.com/openshift/assisted-installer-agent.git" \
summary="OpenShift Assisted Installer Agent" \
io.k8s.display-name="OpenShift Assisted Installer" \
maintainer="Liat Gamliel <[email protected]>" \
description="OpenShift Assisted Installer" \
io.k8s.description="OpenShift Assisted Installer" \
distribution-scope="public" \
release="${release}" \
vendor="Red Hat, Inc." \
upstream_commit="${version}" \
org.label-schema.vcs-ref="${version}" \
org.label-schema.vcs-url="https://github.com/openshift/assisted-installer-agent"