-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.base
42 lines (30 loc) · 1.23 KB
/
Dockerfile.base
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
FROM ubuntu:jammy
LABEL about.license="SPDX:Apache-2.0"
ARG container_user
RUN test -n "${container_user}"
USER root
WORKDIR /tmp
# Enable shell pipefail option
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC
RUN apt-get update -qq -y && apt-get install --no-install-recommends -qq -y \
curl gnupg2 apt-transport-https ca-certificates \
&& update-ca-certificates \
&& apt-get -y autoclean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/*
# Install the tools that I need in all my environments
RUN apt-get update -qq -y && apt-get install --no-install-recommends -qq -y \
bash-completion nmap ncat binutils less dnsutils net-tools iputils-ping \
git htop openssh-client openssh-server sudo tmux neovim socat \
&& apt-get -y autoclean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /run/sshd
RUN adduser --gecos "" --disabled-password ${container_user} \
&& usermod -a -G users ${container_user} \
&& usermod -a -G sudo ${container_user} \
&& echo "${container_user} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${container_user} \
&& chmod 0440 /etc/sudoers.d/${container_user}
USER ${container_user}
CMD ["/bin/bash","-l"]