Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind: Address already in use #159

Open
danielecr opened this issue Apr 26, 2021 · 3 comments
Open

bind: Address already in use #159

danielecr opened this issue Apr 26, 2021 · 3 comments

Comments

@danielecr
Copy link

I tried to start with the docker-compose.yml I found in https://github.com/stilliard/docker-pure-ftpd/blob/master/docker-compose.yml
with some changes:

version: '3.2'

# Usage example: https://github.com/stilliard/docker-pure-ftpd/wiki/Docker-stack-with-Wordpress-&-FTP

services:
  ftpd_server:
    image: stilliard/pure-ftpd
    container_name: pure-ftpd
    ports:
      - target: 21
        published: 21021
        protocol: tcp
        mode: host
      - "40000-40009:30000-30009"
    volumes: # remember to replace /folder_on_disk/ with the path to where you want to store the files on the host machine
      - /srv/pureftp/data:/home/importuser
      - /srv/pureftp/passwd:/etc/pure-ftpd/passwd
# uncomment for ssl/tls, see https://github.com/stilliard/docker-pure-ftpd#tls
#      - "/folder_on_disk/ssl:/etc/ssl/private/"
    environment:
      PUBLICHOST: "localhost"
      FTP_USER_NAME: fileimport
      FTP_USER_PASS: importfile
      FTP_USER_HOME: /home/importuser
# also for ssl/tls:
#      ADDED_FLAGS: "--tls=2"
    restart: always

started by

$ docker-compose -f pureftp-server.yml up

it print

Creating pure-ftpd ... 
Creating pure-ftpd ... done
Attaching to pure-ftpd
pure-ftpd      | Creating user...
pure-ftpd      | Password: 
pure-ftpd      | Enter it again: 
pure-ftpd      |  root user give /home/importuser directory ftpuser owner
pure-ftpd      | Setting default port range to: 30000:30009
pure-ftpd      | Setting default max clients to: 5
pure-ftpd      | Setting default max connections per ip to: 5
pure-ftpd      | Starting Pure-FTPd:
pure-ftpd      |   pure-ftpd  -l puredb:/etc/pure-ftpd/pureftpd.pdb -E -j -R -P localhost   -p 30000:30009 -c 5 -C 5

from the same host:

$ ftp localhost 21021

Connected to localhost.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 2 of 5 allowed.
220-Local time is now 18:30. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (localhost:xxxxxx): fileimport
331 User fileimport OK. Password required
Password:
230 OK. Current directory is /
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
500 I won't open a connection to ::1%96 (only to 192.168.48.1)
ftp: bind: Address already in use
ftp> 

it is "user number 2 of 5 allowed" because I can connect from external address too, but with the same message/problem

I can guess it is a kind of network problem, but what is so special here? other services works

@danielecr
Copy link
Author

solved by adding

network_mode: "host"

maybe adding double quote on mode: "host" would work also

services:
  ftpd_server:
    image: stilliard/pure-ftpd
    container_name: pure-ftpd
    network_mode: "host"
    ports:
      - "21021:21"
      - "30000-30009:30000-30009"
....

@danielecr
Copy link
Author

no. my change does not solve the problem.
It open the service at port 21, not 21021 as specified, because of network_mode

@danielecr danielecr reopened this Apr 26, 2021
@stilliard
Copy link
Owner

H @danielecr
Sorry for the delay, didn't see this was re-opened.

I don't know enough about network_mode in docker sorry, if you're still looking maybe try asking on stackoverflow or on the docker forums.

If you find the answer please let me know to update here thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants