-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (30 loc) · 1.17 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
FROM python:3.8-slim-buster
LABEL maintainer="Naeem Muhammad <[email protected]>"
USER root
WORKDIR /root
SHELL [ "/bin/bash", "-c" ]
RUN apt-get -qq -y update && \
apt-get -qq -y upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
wget git sudo bash-completion vim python-h5py=2.8.0-3 software-properties-common && \
mv /usr/bin/lsb_release /usr/bin/lsb_release.bak && \
apt-get -y autoclean && \
apt-get -y autoremove && \
rm -rf /var/lib/apt-get/lists/*
RUN pip install numpy==1.23.1 scipy==1.9.0 h5py==3.7.0 matplotlib===3.5.2 openpyxl==3.0.10 pandas==1.5.1
# Create user "docker" with sudo powers
RUN useradd -m docker && \
usermod -aG sudo docker && \
echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
cp /root/.bashrc /home/docker/ && \
chown -R --from=root docker /home/docker
WORKDIR /home/docker
ENV HOME /home/docker
ENV USER docker
USER docker
ENV PATH /home/docker/.local/bin:$PATH
# Avoid first use of sudo warning. c.f. https://askubuntu.com/a/22614/781671
RUN touch $HOME/.sudo_as_admin_successful
ENV PATH $HOME/bin/:$PATH
ENV PYTHONPATH $HOME/lib/:$PYTHONPATH
CMD [ "/bin/bash" ]