forked from openshift/assisted-installer-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.assisted_installer_agent
57 lines (48 loc) · 2.19 KB
/
Dockerfile.assisted_installer_agent
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
FROM registry.ci.openshift.org/openshift/release:golang-1.20 AS builder
ARG TARGETPLATFORM
ENV GO111MODULE=on
ENV GOFLAGS=""
WORKDIR /go/src/github.com/openshift/assisted-installer-agent
COPY go.mod .
RUN go mod download
COPY . .
RUN TARGETPLATFORM=$TARGETPLATFORM make build-release
FROM quay.io/centos/centos:stream9
ARG TARGETPLATFORM
RUN if [[ "$TARGETPLATFORM" == "linux/amd64" || -z "$TARGETPLATFORM" ]] ; then dnf install -y biosdevname dmidecode ; fi ; \
if [[ "$TARGETPLATFORM" == "linux/arm64" || -z "$TARGETPLATFORM" ]] ; then dnf install -y dmidecode ; fi ; \
dnf install --setopt=install_weak_deps=False --setopt=tsdocs=False -y \
findutils iputils \
podman \
# inventory
ipmitool file \
sg3_utils \
# disk_speed_check
fio \
# free_addresses
nmap \
# dhcp_lease_allocate
dhclient \
# logs_sender
tar openssh-clients \
# ntp_synchronizer
chrony \
# for the 'nsenter' executable
util-linux-core \
&& dnf update --setopt=install_weak_deps=False --setopt=tsdocs=False -y systemd && dnf clean all && rm -rf /var/cache \
# Clean unnecessary nmap files to reduce image size
&& find /usr/share/nmap/ -mindepth 1 -maxdepth 1 | grep -v nmap-payloads | xargs rm -rf \
# Remove cracklib installed as part of systemd to reduce image size
&& rm -rf /usr/share/cracklib \
# Remove manpages && docs to reduce image size
&& rm -rf /usr/share/man /usr/share/doc \
# Remove RPM/DNF files to reduce image size
&& rm -rf /var/lib/rpm/rpmdb.sqlite /var/lib/dnf
COPY --from=builder /go/src/github.com/openshift/assisted-installer-agent/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
COPY scripts/installer/* /usr/local/bin/