-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathDockerfile.assisted_installer_agent
57 lines (49 loc) · 2.2 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.access.redhat.com/ubi9/go-toolset:1.21 AS builder
ARG TARGETPLATFORM
ENV GO111MODULE=on
ENV GOFLAGS=""
COPY --chown=1001 go.mod .
RUN go mod download
COPY --chown=1001 . .
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 \
# inventory - this contains pci-ids DB, required GPU PCI scan
hwdata \
# 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 /opt/app-root/src/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/