-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 719 Bytes
/
Dockerfile
File metadata and controls
33 lines (25 loc) · 719 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
FROM ubuntu:21.10
ARG CI="true"
ARG user="user"
RUN useradd --create-home $user \
&& mkdir /home/$user/.config \
&& chown -R user /home/$user \
&& usermod -a -G sudo $user
RUN apt-get update \
&& apt-get install -q -y \
"ansible=2.10*" \
"sudo" \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Need passwordless access
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# More realistic
USER $user
COPY requirements.yml ./
RUN ansible-galaxy install -r requirements.yml
COPY group_vars group_vars
COPY playbook.yml ./
COPY templates templates
COPY roles roles
RUN export CI="$CI"
RUN ansible-playbook -e user=$user playbook.yml -c localhost --skip-tags manjaro