Estou tentando conectar ao servidor FTP, implantado a partir da imagem do Docker, usando o cliente Apache:
import org.apache.commons.net.ftp.FTPClient
import java.io.IOException
object FtpClient {
def main(args: Array[String]): Unit = {
val ftpClient = new FTPClient()
try {
ftpClient.connect("localhost", 21)
val success = ftpClient.login("one", "1234")
if (success) {
println("Success connect")
}
} catch {
case e: IOException => throw new RuntimeException(e)
} finally {
//
}
}
}
Servidor FTP executado por:
docker run -d -p 21:21 -p 21000-21010:21000-21010 -e USERS="one|1234" -e ADDRESS=ftp.site.domain delfer/alpine-ftp-server
E recebo o seguinte erro:
Exception in thread "main" java.lang.RuntimeException: org.apache.commons.net.ftp.FTPConnectionClosedException: Connection closed without indication.
at ru.spb.client.FtpClient$.main(FtpClient.scala:23)
at ru.spb.client.FtpClient.main(FtpClient.scala)
Caused by: org.apache.commons.net.ftp.FTPConnectionClosedException: Connection closed without indication.
at org.apache.commons.net.ftp.FTP.getReply(FTP.java:568)
at org.apache.commons.net.ftp.FTP.getReply(FTP.java:556)
EDITAR:
Os logs do Docker retornam:
Changing password for one
New password:
Bad password: too short
Retype password:
adduser: /ftp/one: No such file or directory
passwd: password for one changed by root
seems like pidfd_open syscall does not work, falling back to
polling
failed to watch for direct child exit (pidfd_open error): Operation not permitted
Talvez eu tenha esquecido alguma configuração de conexão importante?