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

ADD does not support FTP URLs #9314

Closed
dtenenba opened this issue Nov 24, 2014 · 16 comments
Closed

ADD does not support FTP URLs #9314

dtenenba opened this issue Nov 24, 2014 · 16 comments
Labels
area/builder exp/expert kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Comments

@dtenenba
Copy link

Hi,

I would like to use the ADD command in a Dockerfile with an FTP url, but it doesn't appear to work.

My Dockerfile has this line in it:

ADD ftp://ftp.stat.math.ethz.ch/Software/R/R-devel.tar.gz /tmp/R-source/

And when I attempt to build it, I get:

Step 5 : ADD ftp://ftp.stat.math.ethz.ch/Software/R/R-devel.tar.gz /tmp/R-source/

2014/11/24 10:49:46 ftp://ftp.stat.math.ethz.ch/Software/R/R-devel.tar.gz: no such file or directory

Unfortunately, the tarball I am trying to download is not available at an HTTP url. Can ADD be modified to support FTP URLs?

I am aware that I could use RUN curl... to download from this URL, but I want the behavior of ADD which checks to see if the URL contents have changed and invalidates the cache if they have.

@dtenenba
Copy link
Author

I've worked around this for now by adding a cron job to download from the FTP url and upload to an S3 bucket. Would still be interested in a fix but it's not a high priority. Close if you have better things to do. ;)

@endersonmaia
Copy link

I'm in need of the same thing here, I need to access an ftp server, that requires me to inform anonymous as user.

So ADD should support ftp://user@host too.

@thaJeztah
Copy link
Member

I think the core team is planning to deprecate / phase out ADD in the future, because there's too much "magic" in this instruction (it downloads, extracts all automatically). So, I doubt this will be implemented.

Perhaps, as an alternative, use curl to download the file? Something like;

RUN curl -u user:password 'ftp://host/file' -o myfile

@dtenenba
Copy link
Author

I would prefer not to use curl for the reasons I mentioned above. I want to invalidate the cache if the file contents change. For that reason I really like the ADD directive and would not want to see it go away. It does exactly what I want it to do (except handle ftp URLs). I can work around the ftp issue using the method mentioned above but without ADD there will be no way to break the cache without changing the Dockerfile, so I would implore you to keep some way of doing that. Thanks.

On November 27, 2014 12:53:25 PM PST, Sebastiaan van Stijn [email protected] wrote:

I think the core team is planning to deprecate / phase out ADD in the
future, because there's too much "magic" in this instruction (it
downloads, extracts all automatically). So, I doubt this will be
implemented.

Perhaps, as an alternative, use curl to download the file? Something
like;

RUN curl -u user:password 'ftp://host/file' -o myfile


Reply to this email directly or view it on GitHub:
#9314 (comment)

@thaJeztah
Copy link
Member

@dtenenba ah, sorry I missed that part that you mentioned it, I was trying to offer @Enderson an alternative for his case.

so I would implore you to keep some way of doing that

Well, I'm not a maintainer so I have no say in this 😄

@jessfraz jessfraz added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. exp/expert labels Feb 26, 2015
@GordonTheTurtle
Copy link

USER POLL

The best way to get notified of updates is to use the Subscribe button on this page.

Please don't use "+1" or "I have this too" comments on issues. We automatically
collect those comments to keep the thread short.

The people listed below have upvoted this issue by leaving a +1 comment:

@bw2

@thaJeztah
Copy link
Member

We haven't seen more requests for this, so I'm closing this as it's not a priority

@hznut
Copy link

hznut commented Nov 29, 2016

+1 Need support for FTP and sambashare

@nick4fake
Copy link

+1

1 similar comment
@GeekLogan
Copy link

+1

@ahwagner
Copy link

Hey @thaJeztah, are we supposed to make additional requests to re-open this issue by adding comments? Or is subscribing to this page as @GordonTheTurtle suggests enough?

Either way, +1.

@thaJeztah
Copy link
Member

@ahwagner it would help if you could describe your use case; t.b.h., we're in doubt if we want to add more complexity to ADD, there's already a lot of things it does. Adding support for ftp would probably require implementing a whole ftp client (what about sftp, etc etc)

@justincormack
Copy link
Contributor

justincormack commented Feb 27, 2017 via email

obruns added a commit to CPPUserGroups/Germany-Hannover that referenced this issue Mar 7, 2017
Take the relevant parts of the toolchain build script from [1] and put
them into a Dockerfile. Work around Docker issue #9314 [2] by fetching
the newlib archive via `curl` instead of using the ADD instruction.

Add gdb dependencies expat-dev, ncurses-dev, python-dev and xz-dev.

[1] https://github.com/istarc/stm32/blob/master/build-ARM-toolchain/build.sh
[2] moby/moby#9314
@GeekLogan
Copy link

@thaJeztah while I can not speak for others, but my primary desire for this feature is rooted in the ability to pull public scientific data into Docker containers at deploy-time. Much of it is stored in public FTP servers which have not/will not be updated to another storage scheme in the foreseeable future.

Example:
https://www.ncbi.nlm.nih.gov/books/NBK158899/

@thaJeztah
Copy link
Member

If it's at deploy time, adding support for ftp to ADD won't be of much help, as that's only during build

@pgcalixto
Copy link

pgcalixto commented Jul 14, 2017

I was trying to download a file with FTP using ADD, during build time, and I couldn't.

Also, some images, like Ubuntu:16.04 (the one I'm using), do not have cURL installed. So, instead of just adding one file to Docker's ADD command:

ADD http-file-01 \
    http-file-02 \
    ...
    ftp-file \
    ...
    <path>

I'd have to add one more Docker command, adding one more layer to the image, and increasing the size of the image for installing cURL:

RUN apt-get update \
 && apt-get install curl \
 && curl -u user:password 'ftp://host/file' -o myfile

+1 for FTP support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/builder exp/expert kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.
Projects
None yet
Development

No branches or pull requests