Skip to content

Commit

Permalink
mongosh
Browse files Browse the repository at this point in the history
  • Loading branch information
identw committed Mar 18, 2024
1 parent c7fd682 commit 78681f1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
1 change: 1 addition & 0 deletions .bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTFILESIZE=99999999
HISTSIZE=99999
export HISTIGNORE="*AWS*:*SECRET*:*TOKEN*:*CREDENTIALS*:*PASS*:"

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
Expand Down
26 changes: 14 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM docker.io/ubuntu:20.04
FROM docker.io/ubuntu:22.04
LABEL org.opencontainers.image.source https://github.com/orangeappsru/db-connect

RUN apt-get update && \
apt-get install --no-install-recommends -y \
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
vim \
bash-completion \
iputils-ping \
Expand All @@ -18,16 +18,18 @@ RUN apt-get update && \
libcurl4 \
openssl \
liblzma5 \
wget && \
wget https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/5.0/multiverse/binary-amd64/mongodb-org-shell_5.0.22_amd64.deb && \
dpkg -i mongodb-org-shell_5.0.22_amd64.deb && \
apt-get autoclean && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -fv /bin/sh && \
ln -s -v /bin/bash /bin/sh
&& curl -o mongodb-mongosh_2.2.0_amd64.deb 'https://repo.mongodb.org/apt/ubuntu/dists/jammy/mongodb-org/5.0/multiverse/binary-amd64/mongodb-mongosh_2.2.0_amd64.deb' \
&& dpkg -i mongodb-mongosh_2.2.0_amd64.deb \
&& rm -fv mongodb-mongosh_2.2.0_amd64.deb \
&& apt-get autoclean \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -fv /bin/sh \
&& ln -s -v /bin/bash /bin/sh \
&& mkdir /user

COPY ./.bash_profile /root/
COPY ./.bash_profile /user/
RUN chmod 755 /user; chmod 755 /user/.bash_profile
COPY ./entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]
4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash
#!/usr/bin/env bash
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
cp -fv /user/.bash_profile ${HOME}/.bashrc
echo "" > ${HOME}/.sudo_as_admin_successful
exec sleep infinity

0 comments on commit 78681f1

Please sign in to comment.