-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
39 lines (32 loc) · 1.27 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
FROM bergercookie/albertlauncher:ubuntu18.04
# Arguments --------------------------------------------------------------------
ARG USERNAME=someuser
ARG UID=1000
ARG GID=1000
ARG HOME="/home/someuser"
ARG SRC
# Environment ------------------------------------------------------------------
ENV UID_=$UID
ENV GID_=$GID
# local configuration ----------------------------------------------------------
# install packages -------------------------------------------------------------
# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install --no-install-recommends -y vim sudo \
python3 python3-pip python3-setuptools \
libsasl2-dev python-dev libldap2-dev libssl-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --upgrade wheel pyopenssl
RUN pip3 install --upgrade secrets requests ddgr cookiecutter
# don't be root ----------------------------------------------------------------
RUN echo "$USERNAME:x:$UID_:$GID_:$USERNAME,,,:$HOME:/bin/bash" >> /etc/passwd
RUN echo "$USERNAME:x:$UID_:" >> /etc/group
RUN echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USERNAME
RUN chmod 0440 /etc/sudoers.d/$USERNAME
RUN chown "$UID_:$GID_" -R $HOME
RUN mkdir -p $SRC
RUN chown "$UID_:$GID_" -R $SRC
USER $USERNAME
ENV HOME $HOME
WORKDIR $SRC