Skip to content

Commit 6b79a71

Browse files
committed
Switch local copy operations to use COPY instead of ADD as recommended in
docker docs and pointed out by hadolint.
1 parent ae34504 commit 6b79a71

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

Dockerfile.rocky8

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,14 +1718,15 @@ ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
17181718
RUN chmod +x /tini
17191719
ENTRYPOINT ["/tini", "--"]
17201720

1721-
ADD docker-entry.sh /app/docker-entry.sh
1722-
ADD migrid-httpd.env /app/migrid-httpd.env
1723-
ADD migrid-httpd-init.sh /app/migrid-httpd-init.sh
1724-
ADD apache-init-helper /etc/init.d/apache-minimal
1721+
# NOTE: it's recommended to use COPY over ADD except when URL/unpack is needed
1722+
COPY docker-entry.sh /app/docker-entry.sh
1723+
COPY migrid-httpd.env /app/migrid-httpd.env
1724+
COPY migrid-httpd-init.sh /app/migrid-httpd-init.sh
1725+
COPY apache-init-helper /etc/init.d/apache-minimal
17251726
# NOTE: inherit explicit LANG set above for apache and migrid services
17261727
RUN sed "s/#LANG=.*/LANG=${LANG}/g" /app/migrid-httpd-init.sh > /etc/sysconfig/apache-minimal
17271728
RUN grep LANG /etc/sysconfig/apache-minimal > /etc/sysconfig/migrid
1728-
ADD rsyslog-init-helper /etc/init.d/rsyslog-minimal
1729+
COPY rsyslog-init-helper /etc/init.d/rsyslog-minimal
17291730
RUN chown $USER:$GROUP /app/docker-entry.sh \
17301731
&& chmod +x /app/docker-entry.sh
17311732

Dockerfile.rocky9

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,14 +1605,15 @@ ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
16051605
RUN chmod +x /tini
16061606
ENTRYPOINT ["/tini", "--"]
16071607

1608-
ADD docker-entry.sh /app/docker-entry.sh
1609-
ADD migrid-httpd.env /app/migrid-httpd.env
1610-
ADD migrid-httpd-init.sh /app/migrid-httpd-init.sh
1611-
ADD apache-init-helper /etc/init.d/apache-minimal
1608+
# NOTE: it's recommended to use COPY over ADD except when URL/unpack is needed
1609+
COPY docker-entry.sh /app/docker-entry.sh
1610+
COPY migrid-httpd.env /app/migrid-httpd.env
1611+
COPY migrid-httpd-init.sh /app/migrid-httpd-init.sh
1612+
COPY apache-init-helper /etc/init.d/apache-minimal
16121613
# NOTE: inherit explicit LANG set above for apache and migrid services
16131614
RUN sed "s/#LANG=.*/LANG=${LANG}/g" /app/migrid-httpd-init.sh > /etc/sysconfig/apache-minimal
16141615
RUN grep LANG /etc/sysconfig/apache-minimal > /etc/sysconfig/migrid
1615-
ADD rsyslog-init-helper /etc/init.d/rsyslog-minimal
1616+
COPY rsyslog-init-helper /etc/init.d/rsyslog-minimal
16161617
RUN chown $USER:$GROUP /app/docker-entry.sh \
16171618
&& chmod +x /app/docker-entry.sh
16181619

0 commit comments

Comments
 (0)