Skip to content

Commit

Permalink
Merge pull request #293 from spolti/RHOAIENG-7291-012
Browse files Browse the repository at this point in the history
[RHOAIENG-7291] - [Set latest Tag] OpenDataHub - Modelmesh
  • Loading branch information
openshift-merge-bot[bot] authored May 23, 2024
2 parents 24d7d82 + 0946111 commit 7cd43a9
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
###############################################################################
# Stage 2: Copy build assets to create the smallest final runtime image
###############################################################################
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 AS runtime
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest AS runtime

ARG USER=2000
ARG IMAGE_VERSION
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.develop
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
###############################################################################

# TODO: replace the "go_toolset" build stage once ubi8/go-toolset:1.21 is available
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 as go-toolset
# the go-toolset 1.21 is based on ubi9, we need to update it in the base image as well.
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest as go-toolset

# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
# We need TARGETOS and TARGETARCH (not BUILDOS and BUILDARCH) since the developer
Expand Down
47 changes: 46 additions & 1 deletion Dockerfile.develop.ci
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,52 @@
###############################################################################
# Create the develop, test, and build environment
###############################################################################
FROM registry.access.redhat.com/ubi8/go-toolset:1.19

# TODO: replace the "go_toolset" build stage once ubi8/go-toolset:1.21 is available
# the go-toolset 1.21 is based on ubi9, we need to update it in the base image as well.
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest as go-toolset

# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
# We need TARGETOS and TARGETARCH (not BUILDOS and BUILDARCH) since the developer
# image should be built for the OS of the developer using it (this is not a "builder image")
ARG TARGETOS
ARG TARGETARCH

ARG GOLANG_VERSION=1.21.6

USER root

ENV HOME=/root \
PATH=/usr/local/go/bin:$PATH:

WORKDIR /workspace

# install necessary tools that are included in the ubi/go-toolset image that we are temporarily replacing
RUN --mount=type=cache,target=/root/.cache/microdnf:rw \
microdnf --setopt=cachedir=/root/.cache/microdnf --nodocs install \
diffutils \
gcc-c++ \
make \
wget \
tar \
git \
which \
&& microdnf update --nodocs \
&& true

# install go
RUN true \
&& wget -qO go.tgz "https://golang.org/dl/go${GOLANG_VERSION}.${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" \
&& tar -C /usr/local -xzf go.tgz \
&& go version \
&& rm go.tgz \
&& true

####################################################################################
# TODO: replace "go-toolset" build stage with ubi/go-toolset:1.21 once available #
# and swap `microdnf` commands for `dnf` #
####################################################################################
FROM go-toolset

# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
# don't provide "default" values (e.g. 'ARG TARGETARCH=amd64') for non-buildx environments,
Expand Down

0 comments on commit 7cd43a9

Please sign in to comment.