Begin add docker to test ansible test image
This commit is contained in:
parent
074a9b05b6
commit
c0d9f69ee7
3 changed files with 14 additions and 0 deletions
7
docker/Dockerfile
Normal file
7
docker/Dockerfile
Normal file
|
@ -0,0 +1,7 @@
|
|||
FROM fedora:38
|
||||
|
||||
RUN dnf install openssh-server -y
|
||||
RUN ssh-keygen -A -v
|
||||
|
||||
EXPOSE 22
|
||||
CMD ["/usr/sbin/sshd", "-D", "-o", "ListenAddress=0.0.0.0"]
|
4
docker/inventory.yaml
Normal file
4
docker/inventory.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
servers:
|
||||
localhost:
|
||||
ansibleConnection: ssh
|
||||
ansibleUser: root
|
3
docker/start
Executable file
3
docker/start
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
docker build -t ansible_test:latest docker/
|
||||
docker run --rm -d --name ansible_test --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw --volume="$HOME/.ssh/id_rsa.pub:/root/.ssh/authorized_keys" -p 1022:22 --cgroupns=host ansible_test:latest
|
Loading…
Reference in a new issue