-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
64 lines (53 loc) · 2.23 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM ubuntu:bionic
MAINTAINER Audris Mockus <[email protected]>
USER root
ARG DEBIAN_FRONTEND=noninteractive
RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
RUN apt update && DEBIAN_FRONTEND='noninteractive' apt install -y wget curl gnupg apt-transport-https
#mongodb
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
RUN echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list
#RUN echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" > /etc/apt/sources.list.d/mongodb-org-4.0.list
RUN apt update && \
ln -s /bin/true /usr/local/bin/systemctl && \
apt install -y mongodb-org-shell mongodb-org-server \
mongodb-org-tools mongodb-org-mongos \
libssl-dev \
libcurl4-openssl-dev \
openssh-server \
lsof sudo \
sssd \
sssd-tools \
vim \
git \
curl lsb-release \
vim-runtime tmux zsh zip \
python3-pymongo python3-requests \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /usr/local/bin/systemctl \
&& rm -rf /var/lib/mongodb \
&& mv /etc/mongod.conf /etc/mongod.conf.orig
RUN mkdir -p /data/db /data/configdb \
&& chown -R mongodb:mongodb /data/db /data/configdb
VOLUME /data/db /data/configdb
#install ldap authentication to use utk's ldap: would work only with proper port forwarding
COPY eecsCA_v3.crt /etc/ssl/
COPY sssd.conf /etc/sssd/
COPY common* /etc/pam.d/
RUN chmod 0600 /etc/sssd/sssd.conf /etc/pam.d/common*
RUN if [ ! -d /var/run/sshd ]; then mkdir /var/run/sshd; chmod 0755 /var/run/sshd; fi
COPY init.sh startsvc.sh startshell.sh notebook.sh startDef.sh /bin/
ENV NB_USER audris
ENV NB_UID 22923
ENV NB_GID 2343
# ENV NB_USER lgonzal6
# ENV NB_UID 26450
# ENV NB_GID 2075
ENV HOME /home/$NB_USER
RUN groupadd -g $NB_GID da
RUN useradd -m -s /bin/bash -N -u $NB_UID -g $NB_GID $NB_USER && mkdir $HOME/.ssh && chown -R $NB_USER:users $HOME
COPY id_rsa_gcloud.pub $HOME/.ssh/authorized_keys
COPY ssh_config $HOME/.ssh/config
COPY run*.sh *.py /home/$NB_USER/
RUN chown -R $NB_USER:users $HOME && chmod -R og-rwx $HOME/.ssh