Skip to content

Commit

Permalink
mongodb compass
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaofeng1227 committed Jan 2, 2024
1 parent fd81e24 commit 15a22d1
Showing 1 changed file with 22 additions and 38 deletions.
60 changes: 22 additions & 38 deletions apps/mongocompass/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,29 @@ LABEL org.opencontainers.image.authors="https://www.websoft9.com" \
org.opencontainers.image.vendor="Websoft9 Inc." \
org.opencontainers.image.version="1.41.0"

ENV HOME /home/kasm-default-profile
ENV STARTUPDIR /dockerstartup
ENV COMPASSVERSION=1.41.0
WORKDIR $HOME


######### Customize Container Here ###########

RUN apt update -y && \
apt install -y kde-cli-tools && \
apt install -y kde-runtime && \
apt install -y trash-cli && \
apt install -y libglib2.0-bin && \
apt install -y gvfs-bin && \
apt install -y gnome-keyring

RUN apt install -y sudo \
&& useradd -m -d /home/kasm-user -s /bin/bash kasm-user \
&& echo 'kasm-user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

RUN wget https://downloads.mongodb.com/compass/mongodb-compass_$COMPASSVERSION_amd64.deb \
&& dpkg -i mongodb-compass_$COMPASSVERSION_amd64.deb \
&& cp /usr/share/applications/mongodb-compass.desktop $HOME/Desktop/ \
&& chmod +x $HOME/Desktop/mongodb-compass.desktop \
&& chown 1000:1000 $HOME/Desktop/mongodb-compass.desktop

RUN desktop-file-edit \
--set-key="Exec" --set-value="sudo mongodb-compass %U --no-sandbox" \
$HOME/Desktop/mongodb-compass.desktop

RUN rm -rf mongodb-compass_$COMPASSVERSION_amd64.deb

######### End Customizations ###########

RUN chown 1000:0 $HOME
RUN $STARTUPDIR/set_user_permission.sh $HOME

ENV STARTUPDIR /dockerstartup
ENV HOME /home/kasm-user
WORKDIR $HOME
RUN mkdir -p $HOME && chown -R 1000:0 $HOME

USER 1000
# Install MongoDB Compass
RUN apt update -y && apt install -y \
sudo \
--no-install-recommends && \
useradd -m -d $HOME -s /bin/bash kasm-user && \
echo 'kasm-user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
wget -q https://downloads.mongodb.com/compass/mongodb-compass_${COMPASSVERSION}_amd64.deb && \
dpkg -i mongodb-compass_${COMPASSVERSION}_amd64.deb && \
rm -rf mongodb-compass_${COMPASSVERSION}_amd64.deb /var/lib/apt/lists/* && \
cp /usr/share/applications/mongodb-compass.desktop $HOME/Desktop/ && \
chmod +x $HOME/Desktop/mongodb-compass.desktop && \
chown 1000:1000 $HOME/Desktop/mongodb-compass.desktop && \
desktop-file-edit --set-key="Exec" --set-value="sudo mongodb-compass %U --no-sandbox" $HOME/Desktop/mongodb-compass.desktop

# Set permissions
RUN chown 1000:0 $HOME && \
$STARTUPDIR/set_user_permission.sh $HOME && \
mkdir -p $HOME && \
chown -R 1000:0 $HOME

USER 1000

0 comments on commit 15a22d1

Please sign in to comment.