-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional Dockerfile optimization on PR feedback
- Loading branch information
Showing
1 changed file
with
4 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 - && \ | ||
|
@@ -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 | ||
|
@@ -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 |