@@ -12,38 +12,25 @@ server_url = "http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-#
1212server_archive_basename = File.basename(server_url)
1313server_extracted_dir = server_archive_basename.sub(/\.(tar\.gz|tgz)$/, '')
1414
15- toolchain_upper='f11598d091441ffc8d746aacfdc6c26741a3e629'
16- toolchain_lower='5e46f2793e8e866f36eda2c5_20_02_14_19_18_18'
15+ toolchain_upper='717e3e0a26debdc100fecee0d093e488ee7a0219'
1716
18- ruby_toolchain_url = "https://s3.amazonaws.com//mciuploads/mongo-ruby-toolchain/#{distro}/#{toolchain_upper}/mongo_ruby_driver_toolchain_#{distro.gsub('-', '_')}_patch_#{toolchain_upper}_#{toolchain_lower}.tar.gz"
17+ ruby_toolchain_url = "http://boxes.10gen.com/build/toolchain-drivers/mongo-ruby-driver/ruby-toolchain-#{distro}-#{toolchain_upper}.tar.xz"
18+ #ruby_toolchain_url = "https://s3.amazonaws.com//mciuploads/mongo-ruby-toolchain/#{distro}/#{toolchain_upper}/mongo_ruby_driver_toolchain_#{distro.gsub('-', '_')}_patch_#{toolchain_upper}_#{toolchain_lower}.tar.gz"
1919
2020%>
2121
2222FROM <%= base_image %>
2323
24- # increment to force apt-get update to run
25- RUN echo 2
26-
2724<% if debian? %>
2825
2926 ENV DEBIAN_FRONTEND=noninteractive
3027
31- RUN apt-get update
32-
33- RUN apt-get install -y curl
34-
35- <% if preload? && distro =~ /ubuntu1204/ %>
36-
37- # ubuntu1204 comes with python 2.7.3.
38- # Install a more recent one from deadsnakes ppa so that pip works.
39- RUN apt-get install -y python-software-properties
40- # https://github.com/deadsnakes/issues/issues/53
41- RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BB92C09DB82666C
42- RUN add-apt-repository ppa:fkrull/deadsnakes-python2.7
43- RUN apt-get update
44- RUN apt-get install -y python2.7-dev
45-
46- <% end %>
28+ # increment the counter to force apt-get update to run.
29+ # zsh is not required for any scripts but it is a better interactive shell
30+ # than bash.
31+ RUN echo 2 && \
32+ apt-get update && \
33+ apt-get install -y curl zsh
4734
4835<% end %>
4936
@@ -68,10 +55,12 @@ RUN echo 2
6855
6956 # Ruby runtime dependencies: libyaml-0-2
7057 # Compiling ruby libraries: gcc make
58+ # Compiling pyhton packages: python2.7-dev
7159 # JRuby: openjdk-8-jre
72- # Server dependencies: libsnmp30 libcurl3
60+ # Server dependencies: libsnmp30 libcurl3/libcurl4
7361 # Determining OS we are running on: lsb-release
7462 # Kerberos testing: krb5-user
63+ # Local Kerberos server: krb5-kdc krb5-admin-server
7564 # Installing mlaunch from git: git
7665 # ruby-head archive: bzip2
7766 # nio4r on JRuby: libgmp-dev
@@ -81,71 +70,96 @@ RUN echo 2
8170 # distros have pip installed (but none as of this writing have pip3)
8271 # therefore install python-pip in all configurations here.
8372
84- # ubuntu1204, ubuntu1404 only have openjdk-7-jre
85- <% unless %w(ubuntu1204 ubuntu1404).include?(distro) %>
73+ # ubuntu1404 only has openjdk-7-jre
74+ <% if distro !~ / ubuntu1404/ %>
8675 RUN apt-get install -y openjdk-8-jre
8776 <% end %>
88-
89- <% if %w(ubuntu1204).include?(distro) %>
90- RUN apt-get install -y libsnmp15
77+
78+ # ubuntu1404, ubuntu1604: libcurl3
79+ # ubuntu1804: libcurl4
80+ <% if distro =~ /ubuntu1804/ %>
81+ RUN apt-get install -y libcurl4
9182 <% else %>
92- RUN apt-get install -y libsnmp30
83+ RUN apt-get install -y libcurl3
9384 <% end %>
9485
95- # ubuntu1204, ubuntu1404, ubuntu1604: libcurl3
96- RUN apt-get install -y libyaml-0-2 gcc make git lsb-release libcurl3 \
97- krb5-user bzip2 libgmp-dev python-pip
86+ RUN apt-get install -y libsnmp30 libyaml-0-2 gcc make git lsb-release \
87+ krb5-user krb5-kdc krb5-admin-server bzip2 libgmp-dev python-pip python2.7-dev
9888
9989<% else %>
10090
91+ # Enterprise server: net-snmp
10192 # lsb_release: redhat-lsb-core
10293 # our runner scripts: which
10394 # Ruby dependency: libyaml
10495 # compiling python packages: gcc python-devel
10596 # Kerberos tests: krb5-workstation + cyrus-sasl-devel to build the
10697 # mongo_kerberos gem + cyrus-sasl-gssapi for authentication to work
98+ # Local Kerberos server: krb5-server
99+ # JRuby: java-1.8.0-openjdk
107100 #
108101 # Note: lacking cyrus-sasl-gssapi produces a cryptic message
109102 # "SASL(-4): no mechanism available: No worthy mechs found"
110103 # https://github.com/farorm/python-ad/issues/10
111104
112- RUN yum install -y redhat-lsb-core which git gcc python-devel libyaml \
113- krb5-workstation cyrus-sasl-devel cyrus-sasl-gssapi
105+ RUN yum install -y redhat-lsb-core which git gcc libyaml krb5-server \
106+ krb5-workstation cyrus-sasl-devel cyrus-sasl-gssapi java-1.8.0-openjdk \
107+ net-snmp
108+
109+ <% if distro =~ /rhel6/ %>
110+
111+ # RHEL 6 ships with Python 2.6.
112+
113+ RUN yum install -y centos-release-scl && \
114+ yum install -y python27-python python27-python-devel
115+ ENV PATH=/opt/rh/python27/root/usr/bin:$PATH \
116+ LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64
117+
118+ <% else %>
119+
120+ RUN yum install -y python-devel
121+
122+ <% end %>
114123
115124<% end %>
116125
117126<% if preload? %>
118127
119128 WORKDIR /app
120129
121- RUN curl --retry 3 -fL <%= server_download_url %> -o <%= File.basename(server_download_url) %>
122- RUN tar xfz <%= File.basename(server_download_url) %>
123- RUN mv mongo*/ /opt/mongodb
130+ RUN curl --retry 3 -fL <%= server_download_url %> |tar xzf - && \
131+ mv mongo*/ /opt/mongodb
124132 ENV USE_OPT_MONGODB=1
125133
126134 <% unless ruby_head? %>
127135
128- RUN curl --retry 3 -fL <%= ruby_toolchain_url %> -o ruby-toolchain.tar.gz
129- RUN tar -xC /opt -zf ruby-toolchain.tar.gz
130- ENV PATH=/opt/rubies/ <%= ruby %> /bin:$PATH
136+ RUN curl --retry 3 -fL <%= ruby_toolchain_url %> |tar -xC /opt -Jf -
137+ ENV PATH= /opt/rubies/ <%= ruby %> /bin:$PATH \
138+ USE_OPT_TOOLCHAIN=1
131139 #ENV PATH=/opt/rubies/python/3/bin:$PATH
132- ENV USE_OPT_TOOLCHAIN=1
133140
134141 <% end %>
135142
136- <% if distro =~ /ubuntu1204| rhel/ %>
143+ <% if distro =~ /rhel|ubuntu1604 / %>
137144
138145 # Ubuntu 12.04 ships pip 1.0 which is ancient and does not work.
146+ #
147+ # Ubuntu 16.04 apparently also ships a pip that does not work:
148+ # https://stackoverflow.com/questions/37495375/python-pip-install-throws-typeerror-unsupported-operand-types-for-retry
149+ # Potentially this only affects environments with less than ideal
150+ # connectivity (or, perhaps, when python package registry is experiencing
151+ # availability issues) when pip must retry to install packages.
152+ #
139153 # rhel apparently does not package pip at all in core repoitories,
140154 # therefore install it the manual way.
155+ #
141156 # https://pip.pypa.io/en/stable/installing/
142157 RUN curl --retry 3 -fL https://bootstrap.pypa.io/get-pip.py | python
143158
144159 <% end %>
145160
146- RUN pip --version
147-
148- RUN pip install mtools-legacy[mlaunch]
161+ RUN pip --version && \
162+ pip install mtools-legacy[mlaunch]
149163
150164<% end %>
151165
0 commit comments