TheSLYnSmoothOne
TheSLYnSmoothOne

Reputation: 11

How do I create a vsftpd server using docker container?

I'm using powershell to create the docker container so I found a dockerfile and tried to build the image using the dockerfile so I can create my docker container and once it ran it gave me this error "COPY failed: stat /var/lib/docker/tmp/docker-builder246732598/vsftpd.conf: no such file or directory". Also how do I create the docker container with ftp server once this works?

This is what is in my dockerfile

FROM centos:7

ARG USER_ID=14
ARG GROUP_ID=50

MAINTAINER Fer Uria <[email protected]>
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 && yum clean all
RUN yum install -y \
    vsftpd \
    db4-utils \
    db4 \
    iproute && yum clean all

RUN usermod -u ${USER_ID} ftp
RUN groupmod -g ${GROUP_ID} ftp

ENV FTP_USER **String**
ENV FTP_PASS **Random**
ENV PASV_ADDRESS **IPv4**
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

CMD ["/usr/sbin/run-vsftpd.sh"]

Upvotes: 0

Views: 3666

Answers (1)

Simon
Simon

Reputation: 4485

There are missing files (vsftpd.conf). You do not only need to just copy the Dockerfile but also all other files from where you found this Dockerfile. Place the files in the same directory where your Dockerfile is and run the build command again.

Upvotes: 0

Related Questions