title: Docker File to support FTP and SFTP
body: <p>Currently we are using SFTP server,it is built from below Docker file and it is working fine.  Our requirement is to support both FTP and SFTP Protocol in the same container.  Below is the Dockerfile. Any help will be appreciated.</p>
  
  <pre><code>FROM centos
  
  ARG USER_ID=14
  ARG GROUP_ID=50
  
  
  LABEL Description="vsftpd Docker image based on Centos 7. Supports passive mode and virtual users." \
      License="Apache License 2.0" \
      Usage="docker run -d -p [HOST PORT NUMBER]:21 -v [HOST FTP HOME]:/home/vsftpd fauria/vsftpd" \
      Version="1.0"
  
  RUN yum -y update &amp;&amp; yum clean all
  RUN yum install -y \ 
  vsftpd \ 
  db4-utils \ \n
  db4 \ \n
  iproute &amp;&amp; yum clean all \n
  
  RUN usermod -u ${USER_ID} ftp \n
  RUN groupmod -g ${GROUP_ID} ftp \n
  
  ENV FTP_USER **String** \n
  ENV FTP_PASS **Random** \n
  ENV PASV_ADDRESS **IPv4**\n
  ENV PASV_ADDR_RESOLVE NO
  ENV PASV_ENABLE YES
  ENV PASV_MIN_PORT 21100
  ENV PASV_MAX_PORT 21110
  ENV XFERLOG_STD_FORMAT NO
  ENV LOG_STDOUT **Boolean**
  ENV FILE_OPEN_MODE 0666
  ENV LOCAL_UMASK 077
  ENV REVERSE_LOOKUP_ENABLE YES
  COPY vsftpd.conf /etc/vsftpd/
  COPY vsftpd_virtual /etc/pam.d/
  COPY run-vsftpd.sh /usr/sbin/
  RUN chmod +x /usr/sbin/run-vsftpd.sh
  RUN mkdir -p /home/vsftpd/
  RUN chown -R ftp:ftp /home/vsftpd/
  VOLUME /home/vsftpd
  VOLUME /var/log/vsftpd
  EXPOSE 20 21 22
  CMD ["/usr/sbin/run-vsftpd.sh"]
  </code></pre>