Skip to content

Instantly share code, notes, and snippets.

@ttwthomas
Last active December 8, 2023 10:09
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 23 You must be signed in to fork a gist
  • Save ttwthomas/017891e536f745dcbcc5d0bc160a2643 to your computer and use it in GitHub Desktop.
Save ttwthomas/017891e536f745dcbcc5d0bc160a2643 to your computer and use it in GitHub Desktop.
version: '3'
services:
master:
build:
context: .
dockerfile: ./master.Dockerfile
working_dir: /root/playbooks
volumes:
- /c/repos/ansible/playbooks:/root/playbooks
- /c/repos/ansible/config:/etc/ansible
command: tail -f /dev/null
web:
build:
context: .
dockerfile: ./server.Dockerfile
db:
build:
context: .
dockerfile: ./server.Dockerfile
lb:
build:
context: .
dockerfile: ./server.Dockerfile
ports:
- 8080:80
FROM williamyeh/ansible:debian9
RUN apt-get update && apt-get install -y vim python net-tools telnet curl
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y openssh-server vim python net-tools telnet
RUN mkdir /var/run/sshd
RUN echo 'root:ansible' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment