Dockerfile
FROM debian:bookworm-slim
RUN apt update && apt install -y lftp
Send from terminal
docker run -v $(pwd)/file_to_send:/tmp/file_to_send \
-p 2020:20/tcp -p 2121:21/tcp --network host \
ftpdocker lftp ftp://user:123@localhost:21 \
-e "put /tmp/file_to_send; bye"
- Mount file "file_to_send" to container /tmp/file_to_send
- Run client on localhost network (2020 and 2021)
- Execute lftp command with rmeote server URL, username & password
- Send FTP command (file) and close