-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathDockerfile.image-service-mce
More file actions
99 lines (80 loc) · 3.12 KB
/
Dockerfile.image-service-mce
File metadata and controls
99 lines (80 loc) · 3.12 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Used to build external packages:
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:6fc28bcb6776e387d7a35a2056d9d2b985dc4e26031e98a2bd35a7137cd6fd71 AS packages
# Install the build tools and the required libraries:
RUN \
microdnf install -y \
\
gcc \
gzip \
libtool \
make \
tar \
\
libselinux-devel \
libuuid-devel \
libzstd-devel \
lz4-devel \
zlib-devel \
\
&& \
microdnf clean all
# Build the packages:
COPY packages /packages
RUN cd /packages && ./build.sh
# Used to build the service:
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/go-toolset:1.25 AS builder
ARG TARGETOS
ARG TARGETARCH
ENV COMPONENT_NAME=assisted-image-service
ENV COMPONENT_VERSION=1.0.0
ENV COMPONENT_TAG_EXTENSION=" "
ENV GOFLAGS="-p=4"
ENV GOEXPERIMENT=strictfipsruntime
ENV BUILD_TAGS="strictfipsruntime"
ENV USER_UID=1001 \
USER_NAME=assisted-installer
COPY --chown=${USER_UID} . /app
WORKDIR /app
RUN GO111MODULE=on GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -tags strictfipsruntime -o assisted-image-service main.go
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:6fc28bcb6776e387d7a35a2056d9d2b985dc4e26031e98a2bd35a7137cd6fd71
ARG release=main
ARG version=latest
ENV USER_UID=1001 \
USER_NAME=assisted-installer
ARG DATA_DIR=/data
RUN mkdir $DATA_DIR && chmod 775 $DATA_DIR
VOLUME $DATA_DIR
ENV DATA_DIR=$DATA_DIR
ARG DATA_TEMP_DIR=/data_temp
RUN mkdir $DATA_TEMP_DIR && chmod 775 $DATA_TEMP_DIR
VOLUME $DATA_TEMP_DIR
ENV DATA_TEMP_DIR=$DATA_TEMP_DIR
# Install runtime packages directly with microdnf (rpm-prefetching makes them available)
RUN microdnf install -y cpio squashfs-tools && microdnf clean all
# Copy the very minimum that we need from the external packages container. That is the 'dump.erofs'
# binary and the compression library (from the 'xz' package) that it needs.
COPY --from=packages /usr/local/lib/liblzma.so.5 /usr/local/lib
COPY --from=packages /usr/local/bin/dump.erofs /usr/local/bin
COPY LICENSE /licenses/
COPY --from=builder /app/assisted-image-service /assisted-image-service
CMD ["/assisted-image-service"]
USER ${USER_UID}
LABEL com.redhat.component="multicluster-engine-assisted-image-service-container" \
name="multicluster-engine/assisted-image-service-rhel9" \
version="${version}" \
upstream-ref="${version}" \
upstream-url="https://github.com/openshift/assisted-image-service" \
url="https://github.com/openshift/assisted-image-service" \
summary="OpenShift Assisted Image Service" \
io.k8s.display-name="OpenShift Assisted Image Service" \
maintainer="Liat Gamliel <lgamliel@redhat.com>" \
description="OpenShift Assisted Image Service" \
io.k8s.description="OpenShift Assisted Image Service" \
distribution-scope="public" \
release="${release}" \
vendor="Red Hat, Inc." \
io.openshift.tags="OpenShift 4" \
upstream_commit="${version}" \
org.label-schema.vcs-ref="${version}" \
org.label-schema.vcs-url="https://github.com/openshift/assisted-image-service" \
cpe="cpe:/a:redhat:multicluster_engine:2.17::el9"