-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (24 loc) · 905 Bytes
/
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
# Description: This is a testing-env for my ansible playbooks.
# Use the latest version of Ubuntu
FROM ubuntu:latest
# Set the environment variable
ENV DEBIAN_FRONTEND=noninteractive
# Install tzdata package separately
RUN apt-get update -y
RUN apt-get install -y tzdata
# Set your timezone
RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata
# Install sudo
RUN apt-get install -y sudo
# Create a new user named 'younis'
RUN useradd -m younis && echo "younis:younis" | chpasswd && adduser younis sudo
# Allow 'younis' to run sudo commands without a password
RUN echo 'younis ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Switch to the new user
USER younis
# Set the working directory
WORKDIR /home/younis
# Install necessary packages and setup ansible
RUN sudo apt-get install -y curl xz-utils git ansible
# Copy the ansible-playbook
COPY . .