Skip to content

Commit b5b7ff5

Browse files
authored
Reduce the build time for h2o_mruby and php-h2o (#10173)
Signed-off-by: Anton Kirilov <[email protected]>
1 parent 94749c8 commit b5b7ff5

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

frameworks/PHP/php/php-h2o.dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ ARG UBUNTU_VERSION=24.04
22

33
ARG H2O_PREFIX=/opt/h2o
44

5-
FROM "ubuntu:${UBUNTU_VERSION}" AS compile
5+
FROM "buildpack-deps:${UBUNTU_VERSION}" AS compile
66

77
ARG H2O_VERSION=3b9b6a53cac8bcc6a25fb28df81ad295fc5f9402
88

99
ARG DEBIAN_FRONTEND=noninteractive
1010
ARG H2O_PREFIX
1111
WORKDIR /tmp/h2o-build
12-
RUN apt-get -yqq update > /dev/null && \
13-
apt-get -yqq install \
12+
RUN apt-get install \
13+
--no-install-recommends \
14+
-qqUy \
1415
cmake \
1516
curl \
1617
g++ \
@@ -21,6 +22,7 @@ RUN apt-get -yqq update > /dev/null && \
2122
libuv1-dev \
2223
libwslay-dev \
2324
libz-dev \
25+
make \
2426
ninja-build \
2527
pkg-config \
2628
ruby \
@@ -29,10 +31,8 @@ RUN apt-get -yqq update > /dev/null && \
2931
tar --strip-components=1 -xz > /dev/null && \
3032
cmake \
3133
-B build \
32-
-DCMAKE_AR=/usr/bin/gcc-ar \
3334
-DCMAKE_C_FLAGS="-flto=auto -march=native -mtune=native" \
3435
-DCMAKE_INSTALL_PREFIX="${H2O_PREFIX}" \
35-
-DCMAKE_RANLIB=/usr/bin/gcc-ranlib \
3636
-DWITH_MRUBY=on \
3737
-G Ninja \
3838
-S . > /dev/null && \
@@ -46,13 +46,15 @@ ARG PHP_VERSION=8.4
4646
ENV TZ=America/Los_Angeles
4747

4848
ARG DEBIAN_FRONTEND=noninteractive
49-
RUN apt-get -yqq update > /dev/null && \
50-
apt-get -yqq install \
49+
RUN apt-get install \
50+
--no-install-recommends \
51+
-qqUy \
5152
apt-utils \
5253
software-properties-common > /dev/null && \
5354
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \
54-
apt-get -yqq update > /dev/null && \
55-
apt-get -yqq install \
55+
apt-get install \
56+
--no-install-recommends \
57+
-qqUy \
5658
liburing2 \
5759
"php${PHP_VERSION}" \
5860
"php${PHP_VERSION}-cli" \

frameworks/Ruby/h2o_mruby/h2o_mruby.dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ ARG UBUNTU_VERSION=25.10
22

33
ARG H2O_PREFIX=/opt/h2o
44

5-
FROM "ubuntu:${UBUNTU_VERSION}" AS compile
5+
FROM "buildpack-deps:${UBUNTU_VERSION}" AS compile
66

77
ARG H2O_VERSION=3b9b6a53cac8bcc6a25fb28df81ad295fc5f9402
88

99
ARG DEBIAN_FRONTEND=noninteractive
1010
ARG H2O_PREFIX
1111
WORKDIR /tmp/h2o-build
12-
RUN apt-get -yqq update && \
13-
apt-get -yqq install \
12+
RUN apt-get install \
13+
--no-install-recommends \
14+
-qqUy \
1415
cmake \
1516
curl \
1617
g++ \
@@ -21,6 +22,7 @@ RUN apt-get -yqq update && \
2122
libuv1-dev \
2223
libwslay-dev \
2324
libz-dev \
25+
make \
2426
ninja-build \
2527
pkg-config \
2628
ruby \
@@ -29,10 +31,8 @@ RUN apt-get -yqq update && \
2931
tar --strip-components=1 -xz && \
3032
cmake \
3133
-B build \
32-
-DCMAKE_AR=/usr/bin/gcc-ar \
3334
-DCMAKE_C_FLAGS="-flto=auto -march=native -mtune=native" \
3435
-DCMAKE_INSTALL_PREFIX="${H2O_PREFIX}" \
35-
-DCMAKE_RANLIB=/usr/bin/gcc-ranlib \
3636
-DWITH_MRUBY=on \
3737
-G Ninja \
3838
-S . && \
@@ -42,7 +42,7 @@ RUN apt-get -yqq update && \
4242
FROM "ubuntu:${UBUNTU_VERSION}"
4343

4444
ARG DEBIAN_FRONTEND=noninteractive
45-
RUN apt-get -yqq update && apt-get -yqq install liburing2
45+
RUN apt-get install --no-install-recommends -qqUy liburing2
4646
ARG H2O_PREFIX
4747
COPY --from=compile "${H2O_PREFIX}/bin/h2o" "${H2O_PREFIX}/bin/"
4848
COPY --from=compile "${H2O_PREFIX}/share" "${H2O_PREFIX}/share/"

0 commit comments

Comments
 (0)