-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathDockerfile.openshift-appliance.ds
More file actions
65 lines (49 loc) · 2.09 KB
/
Dockerfile.openshift-appliance.ds
File metadata and controls
65 lines (49 loc) · 2.09 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
# Build appliance
FROM registry.access.redhat.com/ubi9/go-toolset:1.25 AS builder
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY . .
RUN cd cmd && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /tmp/openshift-appliance
# Build registry
RUN cd registry && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /tmp/registry
# Set 'oc' image
FROM registry.redhat.io/openshift4/ose-cli AS oc
# Set 'oc-mirror' image
FROM registry.redhat.io/openshift4/oc-mirror-plugin-rhel9 AS oc-mirror
# Create final image
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7
# Create/Mount assets
ARG ASSETS_DIR=/assets
RUN mkdir $ASSETS_DIR && chmod 775 $ASSETS_DIR
VOLUME $ASSETS_DIR
ENV ASSETS_DIR=$ASSETS_DIR
# Install skopeo/podman/libguestfs
RUN microdnf -y install skopeo podman guestfs-tools genisoimage coreos-installer syslinux && microdnf clean all
# Config libguestfs
ENV LIBGUESTFS_BACKEND=direct
# Copy oc binary
COPY --from=oc /usr/bin/oc /usr/bin/oc
# Copy oc-mirror binary
COPY --from=oc-mirror /usr/bin/oc-mirror /usr/bin/oc-mirror
# Copy openshift-appliance binary
COPY --from=builder /tmp/openshift-appliance /openshift-appliance
# Copy registry files
COPY --from=builder /tmp/registry /registry
COPY /registry/config.yml /config.yml
COPY /registry/Dockerfile.registry /Dockerfile.registry
# Copy release bundle files
COPY /bundle/Dockerfile.bundle /Dockerfile.bundle
# Copy
RUN mkdir -p data
COPY /data data
ENTRYPOINT ["/openshift-appliance", "--dir", "assets"]
LABEL summary="OpenShift-based Appliance Builder" \
name="OpenShift-based Appliance Builder" \
description="A utility for building a disk image that orchestrates OpenShift installation using the Agent-based installer." \
io.k8s.description="A utility for building a disk image that orchestrates OpenShift installation using the Agent-based installer." \
io.k8s.display-name="OpenShift-based Appliance Builder" \
io.openshift.tags="openshift,appliance,installer,agent" \
com.redhat.component="openshift-appliance" \
cpe="cpe:/a:redhat:assisted_installer:2.38::el9" \
version="1.0.2"