-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (31 loc) · 869 Bytes
/
Dockerfile
File metadata and controls
39 lines (31 loc) · 869 Bytes
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
# Example dockerfile that shows the installation and setup
# process from a simulated fresh ubuntu image.
FROM ubuntu:latest
USER root
WORKDIR /root
# Prompt avoidance
ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=xterm-256color
ENV PIP_BREAK_SYSTEM_PACKAGES=1
ENV USER=admin
# Install packages required for Ansible
# to set up the rest
RUN apt-get update -y && apt-get install -y \
python3 \
python3-pip \
git \
sudo \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --upgrade \
ansible
# Configure a user with sudo access, like a fresh linux install would
RUN groupadd -r admin && \
useradd -rm -d /app -s /bin/bash -g admin -G sudo admin && \
echo 'admin:admin' | chpasswd
USER admin
WORKDIR /app
COPY --chown=admin:admin / /app
ENTRYPOINT [ "/bin/bash" ]
CMD [ "-l" ]