Skip to content

Commit b411b6e

Browse files
committed
[TASK] Use single instruction to copy data and chown
This reduces the image layers by one.
1 parent 56bb45c commit b411b6e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

mariadb.Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ RUN docker-entrypoint.sh --datadir /var/lib/mysql-data
2323

2424
FROM base
2525

26-
COPY --from=init /var/lib/mysql-data /var/lib/mysql
27-
28-
RUN chown mysql:mysql /var/lib/mysql
26+
COPY \
27+
--from=init \
28+
--chown=mysql:mysql \
29+
/var/lib/mysql-data \
30+
/var/lib/mysql

mysql.Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ RUN docker-entrypoint.sh --datadir /var/lib/mysql-data
2323

2424
FROM base
2525

26-
COPY --from=init /var/lib/mysql-data /var/lib/mysql
27-
28-
RUN chown mysql:mysql /var/lib/mysql
26+
COPY \
27+
--from=init \
28+
--chown=mysql:mysql \
29+
/var/lib/mysql-data \
30+
/var/lib/mysql

0 commit comments

Comments
 (0)