@@ -37,73 +37,74 @@ LABEL org.opencontainers.image.vendor="Kévin Dunglas"
3737
3838# yum update
3939RUN sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo && \
40- sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo && \
41- sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo && \
42- yum clean all && \
43- yum makecache && \
44- yum update -y && \
45- yum install -y centos-release-scl
40+ sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo && \
41+ sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo && \
42+ yum clean all && \
43+ yum makecache && \
44+ yum update -y && \
45+ yum install -y centos-release-scl
4646
4747# different arch for different scl repo
4848RUN if [ "$(uname -m)" = "aarch64" ]; then \
49- sed -i 's|mirror.centos.org/centos|vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo ; \
50- sed -i 's|mirror.centos.org/centos|vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl.repo ; \
51- sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo ; \
52- sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo ; \
53- else \
54- sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo ; \
55- sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo ; \
56- sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo ; \
57- fi ; \
58- yum update -y && \
59- yum install -y devtoolset-10-gcc-* && \
60- echo "source scl_source enable devtoolset-10" >> /etc/bashrc && \
61- source /etc/bashrc
49+ sed -i 's|mirror.centos.org/centos|vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo ; \
50+ sed -i 's|mirror.centos.org/centos|vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl.repo ; \
51+ sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo ; \
52+ sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo ; \
53+ else \
54+ sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo ; \
55+ sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo ; \
56+ sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo ; \
57+ fi ; \
58+ yum update -y && \
59+ yum install -y devtoolset-10-gcc-* && \
60+ echo "source scl_source enable devtoolset-10" >> /etc/bashrc && \
61+ source /etc/bashrc
6262
6363# install newer cmake to build some newer libs
64- RUN curl -o cmake.tgz -fsSL https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-$(uname -m).tar.gz && \
65- mkdir /cmake && \
66- tar -xzf cmake.tgz -C /cmake --strip-components 1 && \
67- rm cmake.tgz
64+ RUN curl -o cmake.tar.gz -fsSL https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-$(uname -m).tar.gz && \
65+ mkdir /cmake && \
66+ tar -xzf cmake.tar.gz -C /cmake --strip-components 1 && \
67+ rm cmake.tar.gz
6868
6969# install build essentials
7070RUN yum install -y \
71- perl \
72- make \
73- bison \
74- flex \
75- git \
76- autoconf \
77- automake \
78- tar \
79- unzip \
80- gzip \
81- gcc \
82- bzip2 \
83- patch \
84- xz \
85- libtool \
86- perl-IPC-Cmd ; \
87- curl -o make.tgz -fsSL https://ftp.gnu.org/gnu/make/make-4.4.tar.gz && \
88- tar -zxvf make.tgz && \
89- rm make.tgz && \
90- cd make-4.4 && \
91- ./configure && \
92- make && \
93- make install && \
94- ln -sf /usr/local/bin/make /usr/bin/make ; \
95- if [ "$(uname -m)" = "aarch64" ]; then \
96- GO_ARCH="arm64" ; \
97- else \
98- GO_ARCH="amd64" ; \
99- fi ; \
100- curl -o /usr/local/bin/jq -fsSL https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-${GO_ARCH} && \
101- chmod +x /usr/local/bin/jq && \
102- curl -o go.tar.gz -fsSL https://go.dev/dl/$(curl -fsS https://go.dev/dl/?mode=json | jq -r "first(first(.[] | select(.stable and (.version | startswith(\" go${GO_VERSION}\" )))).files[] | select(.os == \" linux\" and (.kind == \" archive\" ) and (.arch == \" ${GO_ARCH}\" ))).filename" ) && \
103- rm -rf /usr/local/go && \
104- tar -C /usr/local -xzf go.tar.gz && \
105- rm go.tar.gz && \
106- /usr/local/go/bin/go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
71+ perl \
72+ make \
73+ bison \
74+ flex \
75+ git \
76+ autoconf \
77+ automake \
78+ tar \
79+ unzip \
80+ gzip \
81+ gcc \
82+ bzip2 \
83+ patch \
84+ xz \
85+ libtool \
86+ perl-IPC-Cmd ; \
87+ curl -o make.tar.gz -fsSL https://ftp.gnu.org/gnu/make/make-4.4.tar.gz && \
88+ tar -zxvf make.tar.gz && \
89+ cd make-* && \
90+ ./configure && \
91+ make && \
92+ make install && \
93+ ln -sf /usr/local/bin/make /usr/bin/make && \
94+ cd .. && \
95+ rm -Rf make* && \
96+ if [ "$(uname -m)" = "aarch64" ]; then \
97+ GO_ARCH="arm64" ; \
98+ else \
99+ GO_ARCH="amd64" ; \
100+ fi; \
101+ curl -o /usr/local/bin/jq -fsSL https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-${GO_ARCH} && \
102+ chmod +x /usr/local/bin/jq && \
103+ curl -o go.tar.gz -fsSL https://go.dev/dl/$(curl -fsS https://go.dev/dl/?mode=json | jq -r "first(first(.[] | select(.stable and (.version | startswith(\" go${GO_VERSION}\" )))).files[] | select(.os == \" linux\" and (.kind == \" archive\" ) and (.arch == \" ${GO_ARCH}\" ))).filename" ) && \
104+ rm -rf /usr/local/go && \
105+ tar -C /usr/local -xzf go.tar.gz && \
106+ rm go.tar.gz && \
107+ /usr/local/go/bin/go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
107108
108109ENV PATH="/cmake/bin:/usr/local/go/bin:$PATH"
109110
@@ -124,18 +125,26 @@ ENV EXTENSION_DIR='/usr/lib/frankenphp/modules'
124125ENV COMPOSER_ALLOW_SUPERUSER=1
125126
126127# install tools to build packages, if requested - needs gcc 10
127- RUN if [ "${BUILD_PACKAGES}" != "" ]; then \
128- yum install -y make bzip2 openssl-devel libffi-devel zlib-devel libyaml libyaml-devel rpm-build && \
129- curl -o ruby.tar.gz -fsSL https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.2.tar.gz && \
130- tar -xzf ruby.tar.gz && \
131- cd ruby-3.4.2 && \
132- ./configure --without-baseruby && \
133- make && \
134- make install && \
135- cd .. && \
136- rm -rf ruby-3.4.2 ruby.tar.gz && \
137- gem install fpm; \
138- fi
128+ RUN if [ -n "${BUILD_PACKAGES}" ]; then \
129+ yum install -y \
130+ bzip2 \
131+ libffi-devel \
132+ libyaml \
133+ libyaml-devel \
134+ make \
135+ openssl-devel \
136+ rpm-build \
137+ zlib-devel && \
138+ curl -o ruby.tar.gz -fsSL https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.4.tar.gz && \
139+ tar -xzf ruby.tar.gz && \
140+ cd ruby-* && \
141+ ./configure --without-baseruby && \
142+ make && \
143+ make install && \
144+ cd .. && \
145+ rm -rf ruby* && \
146+ gem install fpm; \
147+ fi
139148
140149WORKDIR /go/src/app
141150COPY go.mod go.sum ./
@@ -151,8 +160,10 @@ COPY --link caddy caddy
151160COPY --link internal internal
152161COPY --link package package
153162
154- RUN --mount=type=secret,id=github-token ./build-static.sh && \
155- if [ "${BUILD_PACKAGES}" != "" ]; then \
156- ./build-packages.sh; \
157- fi ; \
163+ RUN --mount=type=secret,id=github-token \
164+ set -eux; \
165+ ./build-static.sh && \
166+ if [ -n "${BUILD_PACKAGES}" ]; then \
167+ ./build-packages.sh; \
168+ fi; \
158169 rm -Rf dist/static-php-cli/source/*
0 commit comments