Escalate privileges to test single user installation

This commit is contained in:
Paul Montero
2017-09-19 00:40:08 -05:00
parent 4d94ef7588
commit 16c7ea351a
7 changed files with 21 additions and 14 deletions

View File

@@ -1,11 +1,12 @@
FROM centos:6 FROM centos:6
RUN useradd -ms /bin/bash user
RUN yum update -y && \ RUN yum update -y && \
yum install -y \ yum install -y \
initscripts \ initscripts \
sudo \ sudo \
&& yum clean all && yum clean all
RUN useradd -ms /bin/bash user \
&& echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
CMD ["/sbin/init"] CMD ["/sbin/init"]

View File

@@ -1,11 +1,12 @@
FROM centos:7 FROM centos:7
RUN useradd -ms /bin/bash user
RUN yum update -y && \ RUN yum update -y && \
yum install -y \ yum install -y \
sudo \ sudo \
which \ which \
&& yum clean all && yum clean all
RUN useradd -ms /bin/bash user \
&& echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
CMD ["/usr/sbin/init"] CMD ["/usr/sbin/init"]

View File

@@ -1,9 +1,7 @@
FROM debian:8 FROM debian:8
RUN useradd -ms /bin/bash user RUN apt-get update \
&& apt-get install -y \
RUN apt-get update && \
apt-get install -y \
curl \ curl \
build-essential \ build-essential \
libbz2-dev \ libbz2-dev \
@@ -19,4 +17,7 @@ WORKDIR /opt/
COPY build /opt/build COPY build /opt/build
RUN bash build RUN bash build
RUN useradd -ms /bin/bash user \
&& echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
CMD ["/sbin/init"] CMD ["/sbin/init"]

View File

@@ -1,7 +1,5 @@
FROM debian:9 FROM debian:9
RUN useradd -ms /bin/bash user
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y \ apt-get install -y \
curl \ curl \
@@ -11,4 +9,7 @@ RUN apt-get update && \
systemd \ systemd \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash user \
&& echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
CMD ["/bin/systemd"] CMD ["/bin/systemd"]

View File

@@ -1,7 +1,5 @@
FROM ubuntu:14.04 FROM ubuntu:14.04
RUN useradd -ms /bin/bash user
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y \ apt-get install -y \
curl \ curl \
@@ -19,4 +17,7 @@ WORKDIR /opt/
COPY build /opt/build COPY build /opt/build
RUN bash build RUN bash build
RUN useradd -ms /bin/bash user \
&& echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
CMD ["/sbin/init"] CMD ["/sbin/init"]

View File

@@ -1,7 +1,5 @@
FROM ubuntu:16.04 FROM ubuntu:16.04
RUN useradd -ms /bin/bash user
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y \ apt-get install -y \
curl \ curl \
@@ -9,4 +7,7 @@ RUN apt-get update && \
sudo \ sudo \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash user \
&& echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
CMD ["/sbin/init"] CMD ["/sbin/init"]

View File

@@ -9,3 +9,4 @@
- 'ruby-2.3.1' - 'ruby-2.3.1'
roles: roles:
- role: rvm1-ansible - role: rvm1-ansible
become: yes