# # Este archivo es para crear imagen en servidor de desarrollo # se le instala servicio ssh y git # FROM python:alpine3.18 RUN apk add --update --no-cache \ openssh-server \ openssh-sftp-server \ openssh-client \ curl git bash nano ARG ROOTPASS=mypassword RUN mkdir /var/run/sshd RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config && \ echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \ echo 'AllowTcpForwarding yes' >> /etc/ssh/sshd_config && \ echo -n "root:$ROOTPASS" | chpasswd # CREATE COMMAND START RUN echo "#!/bin/sh" > /start.sh && \ echo "ssh-keygen -A" >> /start.sh && \ echo 'exec /usr/sbin/sshd -D -e "$@"' >> /start.sh && \ chmod +x -v /start.sh # CUSTOM PROMPT RUN touch /root/.profile && \ echo "alias ll='ls -alF --color=auto'" >> /root/.profile && \ echo "alias la='ls -A --color=auto'" >> /root/.profile && \ echo "alias l='ls -CF --color=auto'" >> /root/.profile && \ echo ". ~/.prompt" >> /root/.profile && \ echo 'export PS1="\r\n\e[30;46m \A \e[37;44m\[ \u\] \e[30;42m\[ \w \]\e[m\r\n\$ "' > /root/.prompt ENV NOTVISIBLE "in users profile" RUN echo "export VISIBLE=now" >> /etc/profile CMD ["/start.sh"] EXPOSE 22 8000