FROM base
MAINTAINER Stefano Alberto Russo <stefano.russo@inaf.it>

# Switch to root
USER root

# Install OpenSSH
RUN apt-get install openssh-server  -y

# Set a fixed password for metauser (will be changed in the entypoint)
RUN echo "metauser:metapass" | chpasswd

# Set entrypoint command
COPY files/entrypoint.sh /usr/bin/entrypoint.sh
RUN chmod 755 /usr/bin/entrypoint.sh
ENV DEFAULT_ENTRYPOINT_COMMAND="/usr/bin/entrypoint.sh"

# Fix home permissions
RUN chmod 777 /home

# Set user
USER metauser

# Set container name
ENV CONTAINER_NAME='ssh'



