forked from ksiller/ds2002-course
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (38 loc) · 2.02 KB
/
Dockerfile
File metadata and controls
44 lines (38 loc) · 2.02 KB
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
FROM ubuntu:22.04
LABEL maintainer="Neal Magee <nem2p@virginia.edu>"
ARG DEBIAN_FRONTEND=noninteractive
ARG USERNAME=myuser
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG GROUPNAME=mygroup
ENV TZ=America/New_York
# Use apk to install the shadow package
#RUN apk add --no-cache shadow
RUN groupadd --gid $USER_GID $GROUPNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m -s /bin/bash $USERNAME
#RUN addgroup -g ${USER_GID} ${GROUPNAME} \
# && adduser -G ${GROUPNAME} -u ${USER_UID} ${USERNAME} -D
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& rm -rf /var/lib/apt/lists/*
# Ensure the user is in the docker group for DinD (group will be created by docker-in-docker feature)
RUN groupadd -f docker && usermod -aG docker $USERNAME
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common curl \
&& curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor \
&& echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends python3 python3-dev python3-pip nano \
git net-tools jq zip unzip dnsutils httpie tzdata wget htop \
iputils-ping redis-server apt-transport-https pkg-config \
ca-certificates gnupg gcc python3-setuptools libffi-dev \
mongodb-org libmysqlclient-dev groff \
&& apt-get clean autoclean && apt-get autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
# Create python symlink (Ubuntu 22.04 comes with Python 3.10)
RUN ln -sf /usr/bin/python3 /usr/bin/python \
&& mkdir -p "/home/host"
WORKDIR /root
COPY requirements.txt requirements.txt
RUN python3 -m pip install --no-cache-dir -r requirements.txt