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 |
|
eb776d
|
15 |
FROM registry.access.redhat.com/ubi8/ubi |
ac6169
|
16 |
|
eb776d
|
17 |
LABEL vendor=Sonatype \ |
SU |
18 |
maintainer="Sonatype <cloud-ops@sonatype.com>" \ |
|
19 |
com.sonatype.license="Apache License, Version 2.0" \ |
|
20 |
com.sonatype.name="Nexus Repository Manager base image" |
ac6169
|
21 |
|
eb776d
|
22 |
ARG NEXUS_VERSION=3.18.0-01 |
SU |
23 |
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz |
|
24 |
ARG NEXUS_DOWNLOAD_SHA256_HASH=e1d9d84d8b169b2f6c735e7db35e3310cf9e242da12b4af83da4e3618acfc99e |
ac6169
|
25 |
|
eb776d
|
26 |
# configure nexus runtime |
ac6169
|
27 |
ENV SONATYPE_DIR=/opt/sonatype |
eb776d
|
28 |
ENV NEXUS_HOME=${SONATYPE_DIR}/nexus \ |
SU |
29 |
NEXUS_DATA=/nexus-data \ |
ac6169
|
30 |
NEXUS_CONTEXT='' \ |
eb776d
|
31 |
SONATYPE_WORK=${SONATYPE_DIR}/sonatype-work \ |
SU |
32 |
DOCKER_TYPE='rh-docker' |
ac6169
|
33 |
|
eb776d
|
34 |
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION="release-0.5.20190212-155606.d1afdfe" |
SU |
35 |
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" |
|
36 |
|
|
37 |
ADD solo.json.erb /var/chef/solo.json.erb |
|
38 |
|
|
39 |
# Install using chef-solo |
|
40 |
# Chef version locked to avoid needing to accept the EULA on behalf of whomever builds the image |
|
41 |
RUN yum install -y --disableplugin=subscription-manager hostname procps \ |
|
42 |
&& curl -L https://www.getchef.com/chef/install.sh | bash -s -- -v 14.12.9 \ |
|
43 |
&& /opt/chef/embedded/bin/erb /var/chef/solo.json.erb > /var/chef/solo.json \ |
|
44 |
&& chef-solo \ |
|
45 |
--recipe-url ${NEXUS_REPOSITORY_MANAGER_COOKBOOK_URL} \ |
|
46 |
--json-attributes /var/chef/solo.json \ |
|
47 |
&& rpm -qa *chef* | xargs rpm -e \ |
|
48 |
&& rm -rf /etc/chef \ |
|
49 |
&& rm -rf /opt/chefdk \ |
|
50 |
&& rm -rf /var/cache/yum \ |
|
51 |
&& rm -rf /var/chef \ |
|
52 |
&& yum clean all |
ac6169
|
53 |
|
DK |
54 |
VOLUME ${NEXUS_DATA} |
|
55 |
|
|
56 |
EXPOSE 8081 |
eb776d
|
57 |
USER nexus |
ac6169
|
58 |
|
eb776d
|
59 |
ENV INSTALL4J_ADD_VM_PARAMS="-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs" |
ac6169
|
60 |
|
eb776d
|
61 |
CMD ["sh", "-c", "${SONATYPE_DIR}/start-nexus-repository-manager.sh"] |