diff --git a/.bash_profile b/.bash_profile index 10a86fb..b1da386 100644 --- a/.bash_profile +++ b/.bash_profile @@ -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. diff --git a/Dockerfile b/Dockerfile index 4dfe7ff..2f0773a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ @@ -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"] diff --git a/entrypoint.sh b/entrypoint.sh index 35d5a21..2986ed0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 \ No newline at end of file