Docker will build ADD against RUN curl

If I run dockerfile, where I have a command like

RUN curl -o file.txt http://X.X.X.X/path/to/file/file.txt

assembly works, whereas if I use

ADD http://X.X.X.X/path/to/file/file.txt file.txt

Build Failure and Complaints

Got HTTP status code >= 400: 503 Service Unavailable

Is there anything in ADD that I don't understand?

Edit file is also available through the docker host.

+6
source share
2 answers

ADD runs on the docker host.

The manual ADDcopies new files, directories, or URLs of deleted files from <src>and adds them to the image file system along the way <dest>.

RUN runs inside your container.

RUN . Dockerfile.

, RUN curl -o file.txt http://X.X.X.X/path/to/file/file.txt curl, , . curl ( ), RUN . ADD url , curl ( ) , ( Go, ) .


http://X.X.X.X/path/to/file/file.txt -?

: :

, /etc/default/docker. , , .

+6

fox91 . , -, /etc/default/docker. , , , , - .

, ADD docker, .

+1

All Articles