Update Dockerfile
Browse files- Dockerfile +5 -5
Dockerfile
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
FROM debian:latest
|
| 2 |
ARG DEBIAN_FRONTEND=noninteractive
|
| 3 |
RUN apt-get update && apt-get install -y passwd expect sudo
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
RUN useradd -m -
|
| 7 |
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 8 |
RUN echo "admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
| 9 |
COPY su.sh /home/admin/su.sh
|
| 10 |
RUN chown -R 1000 /home && chmod -R 700 /home && chmod +x /home/admin/su.sh
|
| 11 |
-
RUN
|
| 12 |
USER admin
|
| 13 |
WORKDIR /home/admin
|
| 14 |
-
CMD whoami && pwd && ls && (/home/admin/su.sh nonrootuser password whoami)
|
|
|
|
| 1 |
FROM debian:latest
|
| 2 |
ARG DEBIAN_FRONTEND=noninteractive
|
| 3 |
RUN apt-get update && apt-get install -y passwd expect sudo
|
| 4 |
+
RUN useradd -m -u 1000 -s /bin/bash admin
|
| 5 |
+
RUN echo 'admin:pass' | chpasswd
|
| 6 |
+
RUN useradd -m -u 1001 nonrootuser && echo 'nonrootuser:password' | chpasswd
|
| 7 |
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 8 |
RUN echo "admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
| 9 |
COPY su.sh /home/admin/su.sh
|
| 10 |
RUN chown -R 1000 /home && chmod -R 700 /home && chmod +x /home/admin/su.sh
|
| 11 |
+
RUN chown -R 1001 /home && chmod u+s /usr/bin/whoami
|
| 12 |
USER admin
|
| 13 |
WORKDIR /home/admin
|
| 14 |
+
CMD /usr/bin/whoami && pwd && ls && (/home/admin/su.sh nonrootuser password whoami)
|