feat(): initial version

This commit is contained in:
Gareth Flowers 2020-07-10 17:27:43 +01:00 committed by GitHub
commit f4289fa2db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 95 additions and 0 deletions

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM alpine:3.12
ENV FTP_USER=foo \
FTP_PASS=bar
RUN apk add --no-cache --update \
vsftpd==3.0.3-r6
COPY [ "/vsftpd.conf", "/etc" ]
COPY [ "/docker-entrypoint.sh", "/" ]
CMD [ "/usr/sbin/vsftpd" ]
ENTRYPOINT [ "/docker-entrypoint.sh" ]
EXPOSE 21

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Gareth Flowers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

23
README.md Normal file
View File

@ -0,0 +1,23 @@
# FTP Server
A simple FTP server, using `vsftpd`.
## How to use this image
### Start a FTP Server instance
To start a container, with data stored in `/data` on the host, use the following:
```sh
docker run \
--name my-ftp-server \
--detach \
--env FTP_USER=user \
--env FTP_PASS=123 \
--volume /data:/home/user \
--publish 21:21 \
garethflowers/ftp-server
```
## License
* This image is released under the [MIT License](https://raw.githubusercontent.com/garethflowers/docker-ftp-server/master/LICENSE).

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.0.1

20
docker-entrypoint.sh Normal file
View File

@ -0,0 +1,20 @@
#!/bin/sh
set -e
addgroup \
-S \
$FTP_USER
adduser \
-D \
-G $FTP_USER \
-h /home/$FTP_USER \
-s /bin/false \
$FTP_USER
mkdir -p /home/$FTP_USER
chown -R $FTP_USER:$FTP_USER /home/$FTP_USER
echo "$FTP_USER:$FTP_PASS" | /usr/sbin/chpasswd
exec "$@"

16
vsftpd.conf Normal file
View File

@ -0,0 +1,16 @@
anonymous_enable=NO
allow_writeable_chroot=YES
background=NO
chroot_local_user=YES
dirmessage_enable=YES
listen_ipv6=NO
local_enable=YES
local_umask=022
max_clients=10
max_per_ip=5
passwd_chroot_enable=yes
pasv_max_port=50000
pasv_min_port=40000
pasv_enable=Yes
seccomp_sandbox=NO
write_enable=YES