From: W. Trevor King Date: Thu, 11 Sep 2014 23:35:29 +0000 (-0700) Subject: */Dockerfile.template: Replace ADD with COPY X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=707be173773a520571056001fec2a27da2e72235;p=dockerfile.git */Dockerfile.template: Replace ADD with COPY The COPY command landed in Docker v0.12.0 as a less-magical version of ADD [1]. The Docker folks have been replacing assorted ADD occurences with COPY since then [2,3,4]. The only caveat is that it won't work on older versions of Docker, but I agree with a bunch of folks that that's something best dealt with by upgrading your Docker version [5]. [1]: https://github.com/docker/docker/pull/6089 [2]: https://github.com/docker/docker/issues/6912 [3]: https://github.com/docker/docker/pull/6941 [4]: https://github.com/docker/docker/pull/6942 [5]: https://github.com/docker/docker/pull/7471 --- diff --git a/docker-registry/Dockerfile.template b/docker-registry/Dockerfile.template index c6ea9a2..4f8b79a 100644 --- a/docker-registry/Dockerfile.template +++ b/docker-registry/Dockerfile.template @@ -31,7 +31,7 @@ RUN sed -i 's/\(PYTHON_SINGLE_TARGET\)=.*/\1="python2_7"/' /etc/portage/make.con RUN echo 'USE_PYTHON="2.7"' >> /etc/portage/make.conf RUN emerge -v --newuse --deep --with-bdeps=y @system @world RUN eselect python set $(eselect python show --python2) -ADD package.accept_keywords /etc/portage/package.accept_keywords/docker-registry +COPY package.accept_keywords /etc/portage/package.accept_keywords/docker-registry RUN layman -a wtk RUN emerge -v dev-python/blinker dev-python/boto dev-python/backports-lzma dev-python/flask dev-python/flask-cors dev-python/gevent dev-python/pyyaml dev-python/redis-py dev-python/requests dev-python/rsa dev-python/simplejson dev-python/sqlalchemy dev-vcs/git www-servers/gunicorn RUN eselect news read new diff --git a/gentoo-syslog/Dockerfile.template b/gentoo-syslog/Dockerfile.template index 5954635..097144a 100644 --- a/gentoo-syslog/Dockerfile.template +++ b/gentoo-syslog/Dockerfile.template @@ -28,7 +28,7 @@ MAINTAINER ${MAINTAINER} RUN emerge -v sys-process/vixie-cron app-admin/syslog-ng app-admin/logrotate RUN rc-update add syslog-ng default RUN rc-update add vixie-cron default -ADD tail-syslog.sh /usr/bin/tail-syslog +COPY tail-syslog.sh /usr/bin/tail-syslog # Disable logging to tty12 RUN sed -i 's/^\([^#].*console_all.*\)/#\1/' /etc/syslog-ng/syslog-ng.conf diff --git a/nginx-proxy/Dockerfile.template b/nginx-proxy/Dockerfile.template index ea110dc..41168b8 100644 --- a/nginx-proxy/Dockerfile.template +++ b/nginx-proxy/Dockerfile.template @@ -29,9 +29,9 @@ MAINTAINER ${MAINTAINER} RUN mkdir /etc/nginx/vhosts RUN chown nginx:nginx /etc/nginx/vhosts RUN sed -i 's|^\([[:space:]]*\)\(server {\)|\1include vhosts/*.conf;\n\n\1\2|' /etc/nginx/nginx.conf -ADD vhost-template.conf /etc/nginx/vhosts/TEMPLATE +COPY vhost-template.conf /etc/nginx/vhosts/TEMPLATE RUN chown nginx:nginx /etc/nginx/vhosts/TEMPLATE -ADD create-vhosts-from-environment.sh /usr/bin/create-vhosts-from-environment +COPY create-vhosts-from-environment.sh /usr/bin/create-vhosts-from-environment # Uncomment the default HTTPS server RUN sed -i 's/^\t#\([^ ]\)/\t\1/' /etc/nginx/nginx.conf diff --git a/ngircd/Dockerfile.template b/ngircd/Dockerfile.template index 392c9e8..430dcfa 100644 --- a/ngircd/Dockerfile.template +++ b/ngircd/Dockerfile.template @@ -35,7 +35,7 @@ RUN sed -i 's/;Listen = 127.0.0.1,192.168.0.1/Listen = ::,0.0.0.0/' /etc/ngircd/ RUN sed -i 's/;PAM = yes/PAM = no/' /etc/ngircd/ngircd.conf RUN sed -i 's/;SyslogFacility = local1/SyslogFacility = daemon/' /etc/ngircd/ngircd.conf RUN sed -i 's|^\([[:space:]]*\)\(need net\)$|\1\2\n\1use logger|' /etc/init.d/ngircd -ADD setup-ngircd-config-from-environment.sh /usr/bin/setup-ngircd-config-from-environment +COPY setup-ngircd-config-from-environment.sh /usr/bin/setup-ngircd-config-from-environment RUN sed -i 's/Name = irc.example.net/Name = ${HOSTNAME}/' /etc/ngircd/ngircd.conf RUN sed -i 's/;AdminInfo1 = Description/AdminInfo1 = ${DESCRIPTION}/' /etc/ngircd/ngircd.conf RUN sed -i 's/;AdminInfo2 = Location/AdminInfo2 = ${LOCATION}/' /etc/ngircd/ngircd.conf diff --git a/portage/Dockerfile.template b/portage/Dockerfile.template index ca846f3..e4a5ef9 100644 --- a/portage/Dockerfile.template +++ b/portage/Dockerfile.template @@ -27,7 +27,7 @@ MAINTAINER ${MAINTAINER} # -volumes-from doesn't map names, so we need to shift /portage to # /usr/portage. Add a statically-linked BusyBox for RUN commands. -ADD busybox /bin/sh +COPY busybox /bin/sh RUN mkdir /usr/ RUN mv /portage /usr/portage VOLUME ["/usr/portage"]