I'm trying to create a Docker image with git-ftp so I can deploy to an sftp server.
git-ftp requires git and curl compiled with libssh2, which is usually not included, so I found a Docker image from the curl devs which comes with sftp support:
% docker run --rm curlimages/curl:7.79.1 --version
curl 7.79.1-DEV (x86_64-pc-linux-musl) libcurl/7.79.1-DEV OpenSSL/1.1.1l zlib/1.2.11 brotli/1.0.9 libssh2/1.9.0 nghttp2/1.43.0
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s
rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM
NTLM_WB SSL TLS-SRP UnixSockets
However, using it as the base image in my Dockerfile, after installing git I lose sftp support:
FROM curlimages/curl:7.79.1
USER root
RUN apk add --no-cache bash git
RUN git clone https://github.com/git-ftp/git-ftp.git
USER curl_user
WORKDIR /git-ftp
ENTRYPOINT ./git-ftp push --user $FTP_USER --passwd $FTP_PASSWORD $FTP_HOST
% docker run --env FTP_USER=user --env FTP_PASSWORD=password --env FTP_HOST=sftp://localhost:22 git-ftp
fatal: Protocol 'sftp' not supported by curl, exiting...
Running with ENTRYPOINT as curl --version gives me the following:
curl 7.79.1-DEV (x86_64-pc-linux-musl) libcurl/7.79.1 OpenSSL/1.1.1l zlib/1.2.11 brotli/1.0.9 nghttp2/1.43.0
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM
NTLM_WB SSL TLS-SRP UnixSockets
WARNING: curl and libcurl versions do not match. Functionality may be affected.
So, suddenly, after installing git I lose sftp support, which is the only reason I'm using this base image.
What's going on? How can I fix this?