Skip to content

Commit 4292ce7

Browse files
author
Diego Rodriguez Baquero
committed
Upgrade to Lassie 0.16.1
1 parent fc33a81 commit 4292ce7

File tree

1 file changed

+59
-64
lines changed

1 file changed

+59
-64
lines changed

Dockerfile

Lines changed: 59 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
ARG NGINX_VERSION="1.24.0"
2-
ARG NGINX_NAME="nginx-${NGINX_VERSION}"
32

43
FROM docker.io/library/debian:bullseye AS build
54

65
ARG NGINX_VERSION
7-
# https://hg.nginx.org/nginx
8-
ARG NGINX_BRANCH=default
9-
ARG NGINX_COMMIT=c38588d8376b
106
# https://github.com/google/ngx_brotli
117
ARG NGX_BROTLI_COMMIT=6e975bcb015f62e1f303054897783355e2a877dc
128
# https://nginx.org/en/docs/njs/changes.html
@@ -15,50 +11,50 @@ ARG NGX_CAR_RANGE_VERSION="v0.6.0"
1511

1612
# Install dependencies
1713
RUN apt-get update && apt-get install -y \
18-
dpkg-dev \
19-
build-essential \
20-
mercurial \
21-
gnupg2 \
22-
git \
23-
gcc \
24-
cmake \
25-
libpcre3 libpcre3-dev \
26-
zlib1g zlib1g-dev \
27-
openssl \
28-
libssl-dev \
29-
curl \
30-
unzip \
31-
wget \
32-
libxslt-dev \
33-
llvm-dev \
34-
libclang-dev \
35-
clang \
36-
&& rm -rf /var/lib/apt/lists/* \
37-
&& curl https://sh.rustup.rs -sSf | bash -s -- -y \
38-
&& curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v24.1/protoc-24.1-linux-x86_64.zip \
39-
&& unzip protoc-24.1-linux-x86_64.zip -d /usr/local \
40-
&& rm protoc-24.1-linux-x86_64.zip
14+
dpkg-dev \
15+
build-essential \
16+
mercurial \
17+
gnupg2 \
18+
git \
19+
gcc \
20+
cmake \
21+
libpcre3 libpcre3-dev \
22+
zlib1g zlib1g-dev \
23+
openssl \
24+
libssl-dev \
25+
curl \
26+
unzip \
27+
wget \
28+
libxslt-dev \
29+
llvm-dev \
30+
libclang-dev \
31+
clang \
32+
&& rm -rf /var/lib/apt/lists/* \
33+
&& curl https://sh.rustup.rs -sSf | bash -s -- -y \
34+
&& curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v24.1/protoc-24.1-linux-x86_64.zip \
35+
&& unzip protoc-24.1-linux-x86_64.zip -d /usr/local \
36+
&& rm protoc-24.1-linux-x86_64.zip
4137

4238
ENV PATH="/root/.cargo/bin:${PATH}"
4339

4440
WORKDIR /usr/src
4541

4642
RUN echo "Cloning brotli $NGX_BROTLI_COMMIT" \
47-
&& mkdir /usr/src/ngx_brotli \
48-
&& cd /usr/src/ngx_brotli \
49-
&& git init \
50-
&& git remote add origin https://github.com/google/ngx_brotli.git \
51-
&& git fetch --depth 1 origin $NGX_BROTLI_COMMIT \
52-
&& git checkout --recurse-submodules -q FETCH_HEAD \
53-
&& git submodule update --init --depth 1
43+
&& mkdir /usr/src/ngx_brotli \
44+
&& cd /usr/src/ngx_brotli \
45+
&& git init \
46+
&& git remote add origin https://github.com/google/ngx_brotli.git \
47+
&& git fetch --depth 1 origin $NGX_BROTLI_COMMIT \
48+
&& git checkout --recurse-submodules -q FETCH_HEAD \
49+
&& git submodule update --init --depth 1
5450

5551
RUN echo "Cloning njs $NJS_VERSION" \
56-
&& mkdir /usr/src/njs \
57-
&& cd /usr/src \
58-
&& hg clone --rev $NJS_VERSION http://hg.nginx.org/njs /usr/src/njs \
59-
&& cd /usr/src/njs \
60-
&& ./configure \
61-
&& make
52+
&& mkdir /usr/src/njs \
53+
&& cd /usr/src \
54+
&& hg clone --rev $NJS_VERSION http://hg.nginx.org/njs /usr/src/njs \
55+
&& cd /usr/src/njs \
56+
&& ./configure \
57+
&& make
6258

6359
ARG CONFIG="--prefix=/etc/nginx \
6460
--sbin-path=/usr/sbin/nginx \
@@ -94,18 +90,18 @@ ARG CONFIG="--prefix=/etc/nginx \
9490
--add-dynamic-module=/usr/src/ngx_brotli \
9591
--add-dynamic-module=/usr/src/njs/nginx"
9692

97-
RUN echo "Cloning nginx and building $NGINX_VERSION (rev $NGINX_COMMIT from '$NGINX_BRANCH' branch)" \
98-
&& hg clone https://hg.nginx.org/nginx /usr/src/nginx-$NGINX_VERSION \
99-
&& cd /usr/src/nginx-$NGINX_VERSION \
100-
&& hg up release-$NGINX_VERSION \
101-
&& ./auto/configure $CONFIG \
102-
&& make \
103-
&& make install
93+
RUN echo "Downloading and extracting nginx $NGINX_VERSION" \
94+
&& mkdir /usr/src/nginx \
95+
&& curl -fsSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz | tar -zx --strip-components=1 -C /usr/src/nginx
10496

105-
ENV NGINX_DIR=/usr/src/nginx-$NGINX_VERSION
97+
RUN echo "Configuring, building, and installing nginx $NGINX_VERSION" \
98+
&& cd nginx \
99+
&& ./configure $CONFIG \
100+
&& make \
101+
&& make install
106102

107-
RUN echo "Cloning car_range $NGX_CAR_RANGE_VERSION, nginx dir: $NGINX_DIR" \
108-
&& mv $NGINX_DIR/src/http/v2/* $NGINX_DIR/src/http/ \
103+
RUN echo "Cloning car_range $NGX_CAR_RANGE_VERSION" \
104+
&& mv /usr/src/nginx/src/http/v2/* /usr/src/nginx/src/http/ \
109105
&& git clone -b $NGX_CAR_RANGE_VERSION --depth 1 https://github.com/filecoin-saturn/nginx-car-range.git /usr/src/ngx_car_range \
110106
&& cd /usr/src/ngx_car_range \
111107
&& cargo build --release -v --config net.git-fetch-with-cli=true
@@ -114,26 +110,24 @@ FROM docker.io/library/nginx:${NGINX_VERSION}
114110

115111
SHELL ["/bin/bash", "-c"]
116112

117-
ARG NGINX_NAME
118-
119113
COPY --from=build /usr/sbin/nginx /usr/sbin/
120-
COPY --from=build /usr/src/${NGINX_NAME}/objs/ngx_http_brotli_filter_module.so /usr/lib/nginx/modules/
121-
COPY --from=build /usr/src/${NGINX_NAME}/objs/ngx_http_brotli_static_module.so /usr/lib/nginx/modules/
122-
COPY --from=build /usr/src/${NGINX_NAME}/objs/ngx_http_js_module.so /usr/lib/nginx/modules/
114+
COPY --from=build /usr/src/nginx/objs/ngx_http_brotli_filter_module.so /usr/lib/nginx/modules/
115+
COPY --from=build /usr/src/nginx/objs/ngx_http_brotli_static_module.so /usr/lib/nginx/modules/
116+
COPY --from=build /usr/src/nginx/objs/ngx_http_js_module.so /usr/lib/nginx/modules/
123117
COPY --from=build /usr/src/ngx_car_range/target/release/libnginx_car_range.so /usr/lib/nginx/modules/ngx_http_car_range_module.so
124118

125119
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
126-
&& curl -fsSL https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | bash - \
127-
&& apt-get install --no-install-recommends -y \
128-
nodejs \
129-
speedtest \
130-
logrotate \
131-
jq \
132-
&& rm -rf /var/lib/apt/lists/*
120+
&& curl -fsSL https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | bash - \
121+
&& apt-get install --no-install-recommends -y \
122+
nodejs \
123+
speedtest \
124+
logrotate \
125+
jq \
126+
&& rm -rf /var/lib/apt/lists/*
133127

134128
# Download lassie
135129
ARG TARGETPLATFORM
136-
ARG LASSIE_VERSION="v0.15.0"
130+
ARG LASSIE_VERSION="v0.16.1"
137131
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; \
138132
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; \
139133
else ARCHITECTURE=386; fi \
@@ -156,7 +150,8 @@ COPY container/logrotate/* /etc/logrotate.d/
156150
COPY container/cron/* /etc/cron.d/
157151

158152
# Load CIDs ban lists
159-
RUN rm /etc/nginx/conf.d/default.conf && curl -s https://badbits.dwebops.pub/denylist.json | jq 'map({(.anchor): true}) | add' > /etc/nginx/denylist.json
153+
RUN rm /etc/nginx/conf.d/default.conf \
154+
&& curl -s https://badbits.dwebops.pub/denylist.json | jq 'map({(.anchor): true}) | add' > /etc/nginx/denylist.json
160155

161156
# Add logrotate cronjob
162157
RUN chmod 0644 /etc/cron.d/* && { crontab -l; cat /etc/cron.d/logrotate; } | crontab -

0 commit comments

Comments
 (0)