Skip to content

Commit

Permalink
Use mongosh instead of mongo cli
Browse files Browse the repository at this point in the history
  • Loading branch information
arunvelsriram committed Oct 6, 2023
1 parent 0ae606a commit 54295f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ RUN apt-get update \
iputils-ping \
jq \
netcat-openbsd \
mongodb-clients \
mysql-client \
net-tools \
postgresql-client \
Expand All @@ -35,18 +34,22 @@ RUN apt-get update \
tcpdump \
&& rm -rf /var/lib/apt/lists/*

# RabbitMQ tools
RUN curl -1sLf "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf77f1eda57ebb1cc" | gpg --dearmor | tee /usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg > /dev/null \
&& echo 'deb [signed-by=/usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg] http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu bionic main' >> /etc/apt/sources.list.d/rabbitmq.list \
&& echo 'deb-src [signed-by=/usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg] http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu bionic main' >> /etc/apt/sources.list.d/rabbitmq.list \
&& wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | tee /etc/apt/trusted.gpg.d/server-7.0.asc \
&& echo 'deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse' | tee /etc/apt/sources.list.d/mongodb-org-7.0.list \
&& apt-get update \
&& apt-get install --no-install-recommends --yes erlang-base erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl \
&& rm -rf /var/lib/apt/lists/* \
&& wget -q -O rabbitmq.tar.xz https://github.com/rabbitmq/rabbitmq-server/releases/download/v${RABBITMQ_VERSION}/rabbitmq-server-generic-unix-${RABBITMQ_VERSION}.tar.xz \
&& apt-get install --no-install-recommends --yes mongodb-mongosh \
&& rm -rf /var/lib/apt/lists/*

RUN wget -q -O rabbitmq.tar.xz https://github.com/rabbitmq/rabbitmq-server/releases/download/v${RABBITMQ_VERSION}/rabbitmq-server-generic-unix-${RABBITMQ_VERSION}.tar.xz \
&& tar xf rabbitmq.tar.xz \
&& rm rabbitmq.tar.xz \
&& mv rabbitmq*/ /usr/local/rabbitmq
ENV PATH="$PATH:/usr/local/rabbitmq/sbin"

RUN curl -s -O https://raw.githubusercontent.com/rabbitmq/rabbitmq-server/v${RABBITMQ_VERSION}/deps/rabbitmq_management/bin/rabbitmqadmin \
&& mv rabbitmqadmin /usr/local/bin/ \
&& chmod +x /usr/local/bin/rabbitmqadmin
Expand All @@ -71,4 +74,3 @@ RUN groupadd --gid ${UTILS_USER_GID} utils \
--shell /bin/bash --create-home utils
USER utils
WORKDIR /home/utils

4 changes: 2 additions & 2 deletions test/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ load test_helper
[ "$status" -eq 0 ]
}

@test "mongodb-clients" {
run check_cmd "mongo --version"
@test "mongosh" {
run check_cmd "mongosh --version"
[ "$status" -eq 0 ]
}

Expand Down

0 comments on commit 54295f0

Please sign in to comment.