-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (23 loc) · 1021 Bytes
/
Dockerfile
File metadata and controls
27 lines (23 loc) · 1021 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
FROM ubuntu:focal AS base
WORKDIR /usr/local/bin
ENV DEBIAN_FRONTEND=noninteractive
RUN sed -i 's/http:\/\/security.ubuntu.com/http:\/\/archive.ubuntu.com/' /etc/apt/sources.list \
&& apt-get update && apt-get upgrade -y \
&& apt-get install -y software-properties-common curl git build-essential sudo unzip nano fzf \
&& apt-add-repository -y ppa:ansible/ansible \
&& apt-get update && apt-get install -y curl git ansible build-essential \
&& apt-get clean autoclean \
&& apt-get autoremove --yes \
&& sed -i 's/# set bell-style none/set bell-style none/' /etc/inputrc
FROM base AS prime
ARG TAGS
RUN addgroup --gid 1000 alecwang \
&& adduser --gecos alecwang --uid 1000 --gid 1000 --disabled-password alecwang \
&& usermod -aG sudo alecwang \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER alecwang
WORKDIR /home/alecwang
FROM prime
COPY . .
RUN echo "alias pb='ansible-playbook main.yml'" >> /home/alecwang/.bashrc
CMD ["sh", "-c", "ansible-playbook main.yml"]