Custom Search

Sunday, November 18, 2018

What is the difference between the `COPY` and `ADD` commands in a Dockerfile

$ vim Dockerfile

FROM centos:7.4.1708

RUN mkdir /mydata

COPY myfiles /mydata/myfiles

ADD myfiles2 /mydata/myfile2

ADD https://files.pythonhosted.org/packages/45/ae/8a0ad77defb7cc903f09e551d88b443304a9bd6e6f124e75c0fbbf6de8f7/pip-18.1.tar.gz /mydata

ADD pip-18.1.tar.gz /mydata/pipunpack

======================

sudo docker build -t myimage1 .

sudo docker run -itd --name mycontainer myimage1

sudo docker ps

sudo docker exec -it e89db4565fea /bin/bash

No comments:

Post a Comment