Changeset 2023:bd164503fe57


Ignore:
Timestamp:
Jan 6, 2021, 5:18:22 PM (11 months ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Rework test server container

- Switch to configuration via configuration file. As I understand the
  Pure-FTPd documentation, configuration happens either by command
  line switches or by specifying just the path of a configuration
  file.

  Before, I didn't notice that the configuration file wasn't used
  because it seems the command line contained all the necessary
  switches for my server configuration.

  Curiously, when using a configuration file, the FTP server no longer
  runs in the foreground, but is moved to the background. This leads
  the container to exit as soon as the server is started. To work
  around this, add `&& sleep infinity` to the `CMD`. The `infinity`
  argument may not be supported in all versions of `sleep`, but for
  the Debian base image of the Pure FTPd image, the argument _is_
  supported. A obscure workaround would be `&& tail -f /dev/null`.

- Let the server in the container listen on port 2121 instead of port
  21. This should avoid network capability problems when starting the
  server. Strangely, I hadn't noticed this problem before. Since it
  happens now (for port 21) with both Docker and Podman on my machine,
  the trigger may be in a common component, say, runc.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r2021 r2023  
    153153        fi
    154154        ${DOCKER} container run --rm --detach --name ${CONTAINER} \
    155                 -p 127.0.0.1:2121:21 -p 127.0.0.1:30000-30009:30000-30009 ${IMAGE}
     155                -p 127.0.0.1:2121:2121 -p 127.0.0.1:30000-30009:30000-30009 ${IMAGE}
  • test_server/Dockerfile

    r2011 r2023  
    3737  find . -name ".empty" -exec rm {} \;
    3838
    39 CMD pure-ftpd -l unix -E -j -A -P localhost -p 30000:30009 -c 5 -C 5
     39EXPOSE 2121
     40
     41# Without the `sleep` command, the FTP server goes into the background
     42# and the container exits immediately.
     43CMD pure-ftpd /etc/pure-ftpd/pure-ftpd.conf && sleep infinity
  • test_server/pure-ftpd.conf

    r1993 r2023  
    3838# Maximum number of simultaneous users
    3939
    40 MaxClientsNumber             50
     40MaxClientsNumber             5
    4141
    4242
     
    5050# Maximum number of simultaneous clients with the same IP address
    5151
    52 MaxClientsPerIP              8
     52MaxClientsPerIP              5
    5353
    5454
     
    177177# Port range for passive connections - keep it as broad as possible.
    178178
    179 # PassivePortRange             30000 50000
     179PassivePortRange             30000 30009
    180180
    181181
     
    185185# addresses.
    186186
    187 # ForcePassiveIP               192.168.0.1
     187ForcePassiveIP               localhost
    188188
    189189
     
    212212
    213213# Listen only locally
    214 Bind                         127.0.0.1,21
     214Bind                         0.0.0.0,2121
    215215
    216216
Note: See TracChangeset for help on using the changeset viewer.