CircleCI docker image should bake in more dependencies

Patch by Ariel Weisberg; Reviewed by Stefan Podkowinski for CASSANDRA-14985
diff --git a/docker/testing/ubuntu18_j11.docker b/docker/testing/ubuntu18_j11.docker
index 30ecdf1..d54eb5e 100644
--- a/docker/testing/ubuntu18_j11.docker
+++ b/docker/testing/ubuntu18_j11.docker
@@ -19,7 +19,7 @@
 
 RUN export DEBIAN_FRONTEND=noninteractive && \
     apt-get update && \
-    apt-get install -y --no-install-recommends software-properties-common apt-utils
+    apt-get install -y --no-install-recommends software-properties-common apt-utils vim
 
 RUN export DEBIAN_FRONTEND=noninteractive && \
     apt-get update && \
diff --git a/docker/testing/ubuntu18_j11_w_dependencies.docker b/docker/testing/ubuntu18_j11_w_dependencies.docker
new file mode 100644
index 0000000..0aaead9
--- /dev/null
+++ b/docker/testing/ubuntu18_j11_w_dependencies.docker
@@ -0,0 +1,37 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# base things off the testing image without dependencies warmed up
+FROM aweisberg/cassandra-testing-ubuntu18-java11
+MAINTAINER Stefan Podkowinski <s.podkowinski@gmail.com>
+
+USER cassandra
+ENV HOME /home/cassandra
+WORKDIR /home/cassandra
+
+# Fetch the maven dependencies in advance since this tends to fail at runtime
+ARG CASSANDRA_GIT_URL=https://gitbox.apache.org/repos/asf/cassandra.git
+RUN /bin/bash -c "git clone ${CASSANDRA_GIT_URL} ~/cassandra && \
+    cd ~/cassandra && ant maven-ant-tasks-retrieve-build && \
+    git checkout origin/cassandra-3.11 && ant maven-ant-tasks-retrieve-build && \
+    git checkout origin/cassandra-3.0 && ant maven-ant-tasks-retrieve-build && \
+    git checkout origin/cassandra-2.2 && ant maven-ant-tasks-retrieve-build && \
+    git checkout origin/cassandra-2.1 && ant maven-ant-tasks-retrieve-build && \
+    rm -fr ~/cassandra"
+
+# Initialize the CCM git repo as well as this also can fail to clone
+RUN /bin/bash -c "source ~/env/bin/activate && \
+    ccm create -n 1 -v git:trunk test && ccm remove test && \
+    ccm create -n 1 -v git:cassandra-3.11 test && ccm remove test && \
+    ccm create -n 1 -v git:cassandra-3.0 test && ccm remove test && \
+    ccm create -n 1 -v git:cassandra-2.2 test && ccm remove test && \
+    ccm create -n 1 -v git:cassandra-2.1 test && ccm remove test"