Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRW-7636 Update Code dockerfiles to use UBI/UBI9 #670

Merged
merged 5 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions devspaces-code/build/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ RUN npm install \
&& cp -r out/src/*.js /checode/launcher \
&& chgrp -R 0 /checode && chmod -R g+rwX /checode

# https://registry.access.redhat.com/ubi8/ubi
FROM registry.access.redhat.com/ubi8/ubi:8.10-1161 AS ubi-builder
# https://registry.access.redhat.com/ubi9
FROM registry.redhat.io/ubi9:9.5-1734495538 AS ubi-builder

RUN mkdir -p /mnt/rootfs
RUN yum install --installroot /mnt/rootfs brotli libstdc++ coreutils glibc-minimal-langpack --releasever 8 --setopt install_weak_deps=false --nodocs -y && yum --installroot /mnt/rootfs clean all
Expand Down Expand Up @@ -186,8 +186,8 @@ COPY --chmod=755 /build/remote-config /mnt/rootfs/remote/data/Machine/
#
##################################################################################################################

# https://registry.access.redhat.com/ubi8-minimal
FROM registry.access.redhat.com/ubi8-minimal:8.10-1154
# https://registry.access.redhat.com/ubi9-minimal
FROM registry.redhat.io/ubi9-minimal:9.5-1734497536
COPY --from=ubi-builder /mnt/rootfs/ /
ENV HOME=/home/che
USER 1001
Expand Down
26 changes: 19 additions & 7 deletions devspaces-code/build/dockerfiles/brew.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ RUN npm install \

# NOTE: can't use scatch images in OSBS, because unable to start container process: exec: \"/bin/sh\": stat /bin/sh: no such file or directory
# so we must rebuild machineexec binary in this build
# https://registry.access.redhat.com/rhel8/go-toolset
FROM registry.redhat.io/rhel8/go-toolset:1.22.9-1 as machineexec-builder
# https://registry.access.redhat.com/ubi9/go-toolset
FROM registry.redhat.io/ubi9/go-toolset:9.5-1733160835 as machineexec-builder
ENV GOPATH=/go/
# hadolint ignore=DL3002
USER root
Expand All @@ -440,12 +440,24 @@ RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -a -ldflags '-w -s' -a -instal
############################# BUILD 4: rootfs assembly ##################
#########################################################################

# https://registry.access.redhat.com/ubi8
FROM registry.redhat.io/ubi8:8.10-1161 as ubi-builder
# https://registry.access.redhat.com/ubi9
FROM registry.redhat.io/ubi9:9.5-1734495538 as ubi-builder

RUN mkdir -p /mnt/rootfs/projects /mnt/rootfs/home/che /mnt/rootfs/remote/data/Machine/
# hadolint ignore=DL3033
RUN yum install --installroot /mnt/rootfs tar gzip brotli libstdc++ coreutils glibc-minimal-langpack --releasever 8 --setopt install_weak_deps=false --nodocs -y && yum --installroot /mnt/rootfs clean all

# Enable pulp content sets to resolve libsecret & libxkbfile as rpm
COPY $REMOTE_SOURCES/devspaces-images-code/app/devspaces-code/build/dockerfiles/content_sets_pulp.repo /etc/yum.repos.d/

RUN echo "Disabling rhel-8 based repos..." && \
dnf config-manager --set-disabled 'rhel-8*'

# hadolint ignore=DL3040,DL3041
RUN \
dnf install -y \
--enablerepo=rhel-9-for-baseos-rpms-pulp \
--enablerepo=rhel-9-for-appstream-rpms-pulp \
--installroot /mnt/rootfs tar gzip brotli libstdc++ coreutils glibc-minimal-langpack --releasever 9 --setopt install_weak_deps=false --nodocs -y && yum --installroot /mnt/rootfs clean all
RUN rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.*

WORKDIR /mnt/rootfs
Expand All @@ -472,8 +484,8 @@ RUN rm /mnt/rootfs/etc/hosts
############################# BUILD 5: minimal final image ##############
#########################################################################

# https://registry.access.redhat.com/ubi8-minimal
FROM registry.redhat.io/ubi8-minimal:8.10-1154
# https://registry.access.redhat.com/ubi9-minimal
FROM registry.redhat.io/ubi9-minimal:9.5-1734497536
COPY --from=ubi-builder /mnt/rootfs/ /
ENV HOME=/home/che
USER 1001
Expand Down