init
This commit is contained in:
commit
a2ef2a9c2b
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
|
RUN apt update && apt install -y --no-install-recommends \
|
||||||
|
openssh-server sudo \
|
||||||
|
systemd systemd-sysv dbus dbus-user-session \
|
||||||
|
software-properties-common
|
||||||
|
|
||||||
|
RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 ubuntu
|
||||||
|
|
||||||
|
RUN echo 'ubuntu:Password123' | chpasswd
|
||||||
|
RUN echo 'root:root' | chpasswd
|
||||||
|
RUN printf '#!/bin/sh\nexit 0' > /usr/sbin/policy-rc.d
|
||||||
|
RUN printf "systemctl start systemd-logind" >> /etc/profile
|
||||||
|
|
||||||
|
|
||||||
|
RUN add-apt-repository "ppa:deadsnakes/ppa"
|
||||||
|
RUN apt update -y
|
||||||
|
RUN apt install -y python3.11
|
||||||
|
|
||||||
|
RUN service ssh start
|
||||||
|
|
||||||
|
EXPOSE 22
|
||||||
|
|
||||||
|
CMD ["/bin/bash", "-c", "/sbin/init", "&&", "/usr/sbin/sshd","-D"]
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
# Docker Ansible Testing
|
||||||
|
|
||||||
|
This repo is to spin up a docker container that runs systemd and openssh to be able to test out ansible playbooks on it.
|
||||||
|
|
||||||
|
|
||||||
|
Getting Started:
|
||||||
|
```sh
|
||||||
|
docker build -t dat:latest .
|
||||||
|
docker run -it --privileged --cap-add=ALL -p 10022:22 --rm -d dat:latest
|
||||||
|
```
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
/sbin/init &
|
||||||
|
/usr/sbin/sshd -D
|
||||||
|
|
Loading…
Reference in New Issue