Skip to content

Commit 7a96817

Browse files
committed
Use the new COPY --link syntax to accelerate builds
1 parent 955df37 commit 7a96817

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

layers/console/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax = docker/dockerfile:1.4
12
ARG PHP_VERSION
23
ARG CPU_PREFIX
34

@@ -7,23 +8,23 @@ RUN apk add composer
78

89
RUN mkdir -p /opt/bref/console-runtime
910
WORKDIR /opt/bref/console-runtime
10-
COPY composer.json composer.json
11+
COPY --link composer.json composer.json
1112
RUN composer install --ignore-platform-req=ext-posix --ignore-platform-req=ext-simplexml
1213

1314
FROM bref/${CPU_PREFIX}php-$PHP_VERSION as console
1415

1516
# Overwrite the "function" bootstrap file
16-
COPY bref/bootstrap.php /opt/bref/bootstrap.php
17+
COPY --link bref/bootstrap.php /opt/bref/bootstrap.php
1718

18-
COPY --from=composer /opt/bref/console-runtime /opt/bref/console-runtime
19+
COPY --link --from=composer /opt/bref/console-runtime /opt/bref/console-runtime
1920

2021
FROM alpine:3.14 as zip-console
2122

2223
RUN apk add zip
2324

2425
RUN mkdir -p /opt/bref
25-
COPY --from=console /opt/bref/bootstrap.php /opt/bref/bootstrap.php
26-
COPY --from=console /opt/bref/console-runtime /opt/bref/console-runtime
26+
COPY --link --from=console /opt/bref/bootstrap.php /opt/bref/bootstrap.php
27+
COPY --link --from=console /opt/bref/console-runtime /opt/bref/console-runtime
2728

2829
WORKDIR /opt
2930

layers/fpm-dev/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax = docker/dockerfile:1.4
12
ARG CPU_PREFIX
23
ARG PHP_VERSION
34

@@ -21,16 +22,16 @@ RUN if [[ $CPU_PREFIX == "arm-" ]]; then curl -A "Docker" -o /opt/bref/extension
2122

2223
FROM bref/${CPU_PREFIX}php-${PHP_VERSION}-fpm
2324

24-
COPY --from=build_extensions /opt /opt
25-
COPY bref-entrypoint.sh /
25+
COPY --link --from=build_extensions /opt /opt
26+
COPY --link bref-entrypoint.sh /
2627
RUN chmod +x /bref-entrypoint.sh
2728

2829
# Install node to run the JS app below
2930
RUN curl --silent --location https://rpm.nodesource.com/setup_16.x | bash -
3031
RUN yum install --setopt=skip_missing_names_on_install=False -y nodejs
3132

3233
# Install the bref/local-api-gateway app in our container (avoids running 2 containers)
33-
COPY --from=bref/local-api-gateway /app /local-api-gateway
34+
COPY --link --from=bref/local-api-gateway /app /local-api-gateway
3435
EXPOSE 8000
3536

3637
# Add `php/conf.dev.d` to the path where PHP looks for configuration files

0 commit comments

Comments
 (0)