-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 759 Bytes
/
Dockerfile
File metadata and controls
27 lines (20 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM ubuntu:22.04
LABEL Description="vsftpd prepopulated image for testing"
# install packages
RUN apt-get update && apt-get install -y --no-install-recommends vsftpd ssl-cert apache2-utils libpam-pwdfile && rm -rf /var/lib/apt/lists/*
# create ftp users
RUN mkdir /etc/vsftpd &&\
htpasswd -cdb /etc/vsftpd/ftpd.passwd user1 pass1 &&\
htpasswd -db /etc/vsftpd/ftpd.passwd user2 pass2 &&\
htpasswd -db /etc/vsftpd/ftpd.passwd user3 ""
# give ftp user daemon uid:gid
RUN usermod -ou 1 ftp && usermod -g 1 ftp
# create working directory
RUN mkdir /var/ftp && mkdir /var/ftp/pub && chown ftp:ftp /var/ftp/pub
VOLUME /var/ftp/pub
# copy configs
ADD root /
# create entrypoint
ENTRYPOINT ["/bootstrap.sh"]
# expose ports
EXPOSE 21 990 21000-21100