Bug 1402592

Summary: MAVEN_VERSION set incorrectly in openshift3/jenkins-slave-maven-rhel7 image
Product: OpenShift Container Platform Reporter: Travis Rogers <trogers>
Component: ImageStreamsAssignee: Ben Parees <bparees>
Status: CLOSED CURRENTRELEASE QA Contact: Wang Haoran <haowang>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: aos-bugs, bparees, jokerman, mmccomas, shiywang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-14 14:00:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Dockerfile-openshift3-jenkins-slave-maven-rhel7-3.3-5 none

Description Travis Rogers 2016-12-07 22:27:31 UTC
Created attachment 1229225 [details]
Dockerfile-openshift3-jenkins-slave-maven-rhel7-3.3-5

Description of problem:
The openshift3/jenkins-slave-maven-rhel7:latest image contains a Dockerfile for Maven (/root/buildinfo/Dockerfile-openshift3-jenkins-slave-maven-rhel7-3.3-5) that incorrectly set the environment variable MAVEN_VERSION=3.3.9 when the image actually contains version 3.0.5 of the maven package.

This is very confusing for customers and might cause downstream build issues for Jenkins.

Version-Release number of selected component (if applicable):
openshift3/jenkins-slave-maven-rhel7:latest in the Red Hat registry


Output from investigating the image:

# docker pull registry.access.redhat.com/openshift3/jenkins-slave-maven-rhel7:latest
Trying to pull repository registry.access.redhat.com/openshift3/jenkins-slave-maven-rhel7 ... 
latest: Pulling from registry.access.redhat.com/openshift3/jenkins-slave-maven-rhel7

30cf2e26a24f: Already exists 
99dd41655d8a: Already exists 
bbf77b72c3f9: Pull complete 
98dac985744b: Pull complete 
Digest: sha256:9b308544b0834034527c2d601bcb38e2855a09a2e0b91c7ac59d4c52e118ce18
Status: Downloaded newer image for registry.access.redhat.com/openshift3/jenkins-slave-maven-rhel7:latest

# docker run --rm -it registry.access.redhat.com/openshift3/jenkins-slave-maven-rhel7 /bin/bash

bash-4.2$ ls -la /root/buildinfo
total 12
drwxr-xr-x. 2 root root  164 Oct 20 10:17 .
dr-xr-x---. 3 root root  131 Sep  6 14:22 ..
-rw-r--r--. 1 root root 1265 Oct 20 09:56 Dockerfile-openshift3-jenkins-slave-base-rhel7-1.0-5
-rw-r--r--. 1 root root 1042 Oct 20 10:13 Dockerfile-openshift3-jenkins-slave-maven-rhel7-3.3-5
-rw-r--r--. 1 root root  805 Sep  6 14:21 Dockerfile-rhel7-rhel-7.2-104

bash-4.2$ which mvn                                            
/usr/bin/mvn

bash-4.2$ ls -la /usr/bin/mvn
-rwxr-xr-x. 1 root root 219 Jan 10  2014 /usr/bin/mvn
bash-4.2$ rpm -qa | grep -i maven
maven-wagon-2.4-3.el7.noarch
maven-3.0.5-16.el7.noarch



Contents of /root/buildinfo/Dockerfile-openshift3-jenkins-slave-maven-rhel7-3.3-5 in the image:

FROM 9a765b0e4c6884a936fee7efec518252acd292df2721ad0b4f3bc0f563e978b5

MAINTAINER Ben Parees <bparees>

# Labels consumed by Red Hat build service
LABEL BZComponent="jenkins-slave-maven-rhel7-docker" \
      Name="openshift3/jenkins-slave-maven-rhel7" \
      Version="3.3" \
      Architecture="x86_64" \
      Release="5"

ENV MAVEN_VERSION=3.3.9

# Install Maven
RUN yum-config-manager --enable rhel-7-server-optional-rpms && \
    INSTALL_PKGS="java-1.8.0-openjdk-devel maven" && \
    yum install -y $INSTALL_PKGS && \
    rpm -V $INSTALL_PKGS && \
    yum clean all -y && \
    mkdir -p $HOME/.m2

ADD ./contrib/settings.xml $HOME/.m2/

RUN chown -R 1001:0 $HOME && \
    chmod -R g+rw $HOME

USER 1001

LABEL "com.redhat.component"="jenkins-slave-maven-rhel7-docker" "name"="openshift3/jenkins-slave-maven-rhel7" "Build_Host"="ip-10-29-120-49.ec2.internal" "version"="3.3" "build-date"="2016-10-20T10:12:36.260229Z" "com.redhat.build-host"="ip-10-29-120-49.ec2.internal" "vcs-ref"="c74b41f6a2c4be23e69ae7a42330b3cdc2b5a7e2"

Comment 1 Ben Parees 2016-12-07 22:37:25 UTC
this has been fixed already, not sure if the images have been rebuilt since the fix went in (and they probably have not been published) so handing off to Troy.

see: https://github.com/openshift/jenkins/blob/master/slave-maven/Dockerfile.rhel7#L15

Comment 2 Troy Dawson 2016-12-07 23:33:23 UTC
Images had not been rebuilt, but they have now.  This fix is in image 
  openshift3/jenkins-slave-maven-rhel7:3.3-9
or newer.

Comment 4 shiyang.wang 2016-12-12 04:57:38 UTC
verified on image:
brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/openshift3/jenkins-slave-maven-rhel7

ENV MAVEN_VERSION=3.0.5

bash-4.2$ rpm -qa | grep -i maven
maven-3.0.5-17.el7.noarch
maven-wagon-2.4-3.el7.noarch