-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild-proftpd-docker.yml
More file actions
62 lines (54 loc) · 1.8 KB
/
build-proftpd-docker.yml
File metadata and controls
62 lines (54 loc) · 1.8 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
# Build a Debian-based Docker image with ProFTPd configured to serve
# anonymous content from /srv/ftp. See also: run-proftpd-docker.yml.
- name: Build a ProFTPd Docker Image for Anonymous FTP
hosts: localhost
connection: local
tasks:
- name: Create temporary directory
tempfile:
state: directory
register: tempdir
- name: Create Dockerfile
copy:
dest: "{{ tempdir.path }}/Dockerfile"
content: |
FROM debian:latest
RUN apt-get update && apt-get install -y proftpd-basic
COPY proftpd.conf /etc/proftpd/proftpd.conf
EXPOSE 20
EXPOSE 21
CMD ["proftpd", "--nodaemon"]
- name: Create proftpd.conf for anonymous FTP
copy:
dest: "{{ tempdir.path }}/proftpd.conf"
content: |
# A basic ProFTPd config file for anaonymous FTP
ServerName "Anonymous FTP"
ServerType standalone
DefaultServer on
RequireValidShell off
UseIPv6 off
Port 21
PassivePorts 49152 65534
Umask 022
MaxInstances 30
<Anonymous /srv/ftp>
User ftp
Group ftp
UserAlias anonymous ftp
DisplayLogin welcome.msg
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>
- name: Build the image
shell:
cmd: docker build -t proftpd-anon {{ tempdir.path }}
- name: Verify image exists
shell:
cmd: docker images | grep proftpd-anon
- name: Clean up temp files
file:
path: "{{ tempdir.path }}"
state: absent