Student User
2019-08-08 27de9efbe220c3e9b48e04014b11eeb4484f28ce
commit | author | age
ac6169 1 # Copyright (c) 2016-present Sonatype, Inc.
DK 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
9f231c 15 FROM registry.access.redhat.com/ubi8/ubi:8.0
ac6169 16
DK 17 LABEL name="Nexus Repository Manager" \
411e81 18       vendor=Sonatype \
DK 19       version="3.18.0-01" \
20       release="3.18.0" \
ac6169 21       url="https://sonatype.com" \
DK 22       summary="The Nexus Repository Manager server \
411e81 23           with universal support for popular component formats." \
DK 24       description="The Nexus Repository Manager server \
ac6169 25           with universal support for popular component formats." \
DK 26       run="docker run -d --name NAME \
27           -p 8081:8081 \
28           IMAGE" \
411e81 29       stop="docker stop NAME" \
DK 30       com.sonatype.license="Apache License, Version 2.0" \
31       com.sonatype.name="Nexus Repository Manager base image" \
32       io.k8s.description="The Nexus Repository Manager server \
ac6169 33           with universal support for popular component formats." \
DK 34       io.k8s.display-name="Nexus Repository Manager" \
35       io.openshift.expose-services="8081:8081" \
411e81 36       io.openshift.tags="Sonatype,Nexus,Repository Manager"
ac6169 37
DK 38
411e81 39 ARG NEXUS_VERSION=3.18.0-01
DK 40 ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
41 ARG NEXUS_DOWNLOAD_SHA256_HASH=e1d9d84d8b169b2f6c735e7db35e3310cf9e242da12b4af83da4e3618acfc99e
ac6169 42
411e81 43 # configure nexus runtime
ac6169 44 ENV SONATYPE_DIR=/opt/sonatype
411e81 45 ENV NEXUS_HOME=${SONATYPE_DIR}/nexus \
DK 46     NEXUS_DATA=/nexus-data \
ac6169 47     NEXUS_CONTEXT='' \
411e81 48     SONATYPE_WORK=${SONATYPE_DIR}/sonatype-work \
DK 49     DOCKER_TYPE='rh-docker'
ac6169 50
411e81 51 ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION="release-0.5.20190212-155606.d1afdfe"
DK 52 ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_URL="https://github.com/sonatype/chef-nexus-repository-manager/releases/download/${NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION}/chef-nexus-repository-manager.tar.gz"
53
54 ADD solo.json.erb /var/chef/solo.json.erb
55
56 # Install using chef-solo
57 # Chef version locked to avoid needing to accept the EULA on behalf of whomever builds the image
58 RUN yum install -y --disableplugin=subscription-manager hostname procps \
59     && curl -L https://www.getchef.com/chef/install.sh | bash -s -- -v 14.12.9 \
60     && /opt/chef/embedded/bin/erb /var/chef/solo.json.erb > /var/chef/solo.json \
61     && chef-solo \
62        --recipe-url ${NEXUS_REPOSITORY_MANAGER_COOKBOOK_URL} \
63        --json-attributes /var/chef/solo.json \
64     && rpm -qa *chef* | xargs rpm -e \
65     && rm -rf /etc/chef \
66     && rm -rf /opt/chefdk \
67     && rm -rf /var/cache/yum \
68     && rm -rf /var/chef \
69     && yum clean all
ac6169 70
DK 71 VOLUME ${NEXUS_DATA}
72
73 EXPOSE 8081
411e81 74 USER nexus
ac6169 75
27de9e 76 ENV INSTALL4J_ADD_VM_PARAMS="-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs"
ac6169 77
411e81 78 ENTRYPOINT ["/uid_entrypoint.sh"]
DK 79 CMD ["sh", "-c", "${SONATYPE_DIR}/start-nexus-repository-manager.sh"]