Skip to content

Commit

Permalink
Additional Dockerfile optimization on PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobrz committed Apr 5, 2023
1 parent cbbdae6 commit 28c9fcc
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions .ci/openshift-ci/build-root/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ ENV VERSION=1.19 \
LOGNAME=deadbeef
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin

# Do all the stuff related with Golang, see https://github.com/openshift/release/blob/master/clusters/app.ci/supplemental-ci-images/ci-tools-build-root.yaml#L338
# Install additional tooling, see https://github.com/openshift/release/blob/master/clusters/app.ci/supplemental-ci-images/ci-tools-build-root.yaml#L338
RUN dnf install -y epel-release && \
rpm -V epel-release && \
INSTALL_PKGS="git tar wget which zip httpd-tools" && \
INSTALL_PKGS="git java-17-openjdk.x86_64 httpd-tools" && \
dnf install -y $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
dnf clean all && \
touch /os-build-image && \
git config --system user.name fabiobrz && \
git config --system user.email [email protected]

# Install Golang
RUN \
set -x && \
curl --fail --retry 3 -L https://golang.org/dl/go$VERSION.linux-amd64.tar.gz | tar -C /usr/local -xzf - && \
Expand All @@ -35,17 +36,6 @@ RUN \
RUN chmod g+xw -R $GOPATH && \
chmod g+xw -R $(go env GOROOT)

# Downloading and installing Java
ENV JAVA_PKG=https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz \
JAVA_HOME=/usr/java/jdk-17

RUN set -eux; \
JAVA_SHA256=$(curl "$JAVA_PKG".sha256) ; \
curl --output /tmp/jdk.tgz "$JAVA_PKG" && \
echo "$JAVA_SHA256 */tmp/jdk.tgz" | sha256sum -c; \
mkdir -p "$JAVA_HOME"; \
tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1

# Downloading and installing Maven
ARG MAVEN_VERSION=3.8.8
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
Expand All @@ -69,7 +59,7 @@ ENV OC_PKG=https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest-4.12
OC_HOME=/usr/oc/oc-4.1.2

RUN set -eux; \
curl -L --output /tmp/oc.tgz "$OC_PKG" -v; \
curl -L --output /tmp/oc.tgz "$OC_PKG"; \
mkdir -p "$OC_HOME"; \
tar --extract --file /tmp/oc.tgz --directory "$OC_HOME"; \
ln -s "$OC_HOME"/oc /usr/bin/oc

0 comments on commit 28c9fcc

Please sign in to comment.