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

Migrate ds-code container from ubi to rhel-els #587

Open
wants to merge 1 commit into
base: devspaces-3-rhel-8
Choose a base branch
from
Open
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
23 changes: 12 additions & 11 deletions devspaces-code/build/dockerfiles/brew.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
############################# BUILD 1: libc-ubi8 ########################
#########################################################################

# https://registry.access.redhat.com/ubi8/nodejs-18
FROM ubi8/nodejs-18:1-110.1716503936 as checode-linux-libc-ubi8-builder
# https://registry.access.redhat.com/rhel9-6-els/rhel
FROM registry.redhat.io/rhel8-6-els/rhel:8.6 as checode-linux-libc-ubi8-builder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the sync.sh script the base Dockerfile is no longer used as a template for the brew one, so it might not be needed at all.

It also looks like the sync script already ignores the build/dockerfiles directory so we don't have to worry about these changes getting overwritten.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will probably get updated automatically, but we should specify a build number, not just 8.6, for reproducibility etc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It allows to build devspaces-code locally and it's helpful for investigation a problem(not related to brew) - as an investigation/debugging on brew is not easy process.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah OK.

# hadolint ignore=DL3002
USER root

Expand Down Expand Up @@ -224,8 +224,8 @@ RUN yarn \
############################# BUILD 2: libc-ubi9 ########################
#########################################################################

# https://registry.access.redhat.com/ubi9/nodejs-18
FROM ubi9/nodejs-18:1-108.1716477799 as checode-linux-libc-ubi9-builder
# https://registry.access.redhat.com/rhel9-2-els/rhel
FROM registry.redhat.io/rhel9-2-els/rhel:9.2-1222 as checode-linux-libc-ubi9-builder
# hadolint ignore=DL3002
USER root

Expand Down Expand Up @@ -446,8 +446,8 @@ RUN yarn \

# 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 rhel8/go-toolset:1.21.9-3 as machineexec-builder
# https://registry.access.redhat.com/rhel9-2-els/rhel
FROM registry.redhat.io/rhel9-2-els/rhel:9.2-1222 as machineexec-builder
ENV GOPATH=/go/
# hadolint ignore=DL3002
USER root
Expand All @@ -457,15 +457,16 @@ USER root
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR $REMOTE_SOURCES_DIR/devspaces-images-code/app/devspaces-machineexec
# hadolint ignore=SC2086
RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -a -ldflags '-w -s' -a -installsuffix cgo -o che-machine-exec . && \
RUN dnf -y install golang && \
CGO_ENABLED=0 GOOS=linux go build -mod=vendor -a -ldflags '-w -s' -a -installsuffix cgo -o che-machine-exec . && \
mkdir -p /rootfs/go/bin && cp -rf $REMOTE_SOURCES_DIR/devspaces-images-code/app/devspaces-machineexec/che-machine-exec /rootfs/go/bin

#########################################################################
############################# BUILD 4: rootfs assembly ##################
#########################################################################

# https://registry.access.redhat.com/ubi8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be updated as well, its how the updateBaseImages script knows what to look for.

FROM ubi8:8.10-901 as ubi-builder
FROM registry.redhat.io/rhel9-2-els/rhel:9.2-1222 as ubi-builder

RUN mkdir -p /mnt/rootfs/projects /mnt/rootfs/home/che /mnt/rootfs/remote/data/Machine/
# hadolint ignore=DL3033
Expand Down Expand Up @@ -496,8 +497,8 @@ RUN rm /mnt/rootfs/etc/hosts
############################# BUILD 5: minimal final image ##############
#########################################################################

# https://registry.access.redhat.com/ubi8-minimal
FROM ubi8-minimal:8.10-896
# https://registry.access.redhat.com/rhel9-2-els/rhel
FROM registry.redhat.io/rhel9-2-els/rhel:9.2-1222
COPY --from=ubi-builder /mnt/rootfs/ /
ENV HOME=/home/che
USER 1001
Expand All @@ -519,4 +520,4 @@ LABEL summary="$SUMMARY" \
maintainer="Roman Nikitenko <[email protected]>" \
io.openshift.expose-services="" \
usage=""