~mclehman/guestctl

ref: 6053daccd97e65d0c636a146cb8a57634b5c4f2a guestctl/resources/templates/dockerfile.tmpl -rw-r--r-- 771 bytes View raw
6053dacc — 0xFORDCOMMA Implement forward-compatible self-management system. 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM {{ base_image }}

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

COPY ssh/sshd_config /etc/ssh/sshd_config
COPY meta /usr/bin/meta
RUN chmod a+x /usr/bin/meta

RUN {{ package_manager }} {{ package_manager_update }} && {{ package_manager }} {{ package_manager_install }} {{ noconfirm }} {{ ssh_server }} sudo vim iproute2 {{ aux_packages }}
RUN ssh-keygen -A

RUN useradd -m {{ user }} && echo '{{ user }}:{{ temporarypassword }}' chpasswd
RUN groupadd -f sudo && gpasswd -a {{ user }} sudo && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

RUN mkdir -p /home/{{ user }}/.ssh
RUN echo '{{ ssh_key }}' > /home/{{ user }}/.ssh/authorized_keys

{{ aux_dockerfile }}

COPY ssh/id_meta /home/{{ user }}/.ssh/id_meta
RUN chown -R {{ user }}:{{ user }} /home/{{ user }}/.ssh