Skip to content

Instantly share code, notes, and snippets.

@ttwthomas
Last active June 12, 2025 13:49
Show Gist options
  • Save ttwthomas/017891e536f745dcbcc5d0bc160a2643 to your computer and use it in GitHub Desktop.
Save ttwthomas/017891e536f745dcbcc5d0bc160a2643 to your computer and use it in GitHub Desktop.

Revisions

  1. ttwthomas revised this gist Jul 31, 2022. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions server.Dockerfile
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,9 @@ RUN apt-get update && apt-get install -y openssh-server vim python net-tools tel
    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
  2. ttwthomas revised this gist Jun 15, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion server.Dockerfile
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ 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

    # 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
  3. ttwthomas created this gist Aug 19, 2019.
    28 changes: 28 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    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
    3 changes: 3 additions & 0 deletions master.Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    FROM williamyeh/ansible:debian9

    RUN apt-get update && apt-get install -y vim python net-tools telnet curl
    15 changes: 15 additions & 0 deletions server.Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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

    # 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"]