Skip to content

Commit bddf24b

Browse files
committed
ubuntu-22.04, all dev deps in the container
1 parent c4542d0 commit bddf24b

File tree

4 files changed

+56
-7
lines changed

4 files changed

+56
-7
lines changed

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"[dockerfile]": {
3+
"editor.formatOnSave": false,
4+
"editor.defaultFormatter": null
5+
}
6+
}

Dockerfile

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
# Use Debian Bullseye as a base image to link against glibc 2.31.
2-
FROM public.ecr.aws/debian/debian:bullseye-slim AS base
1+
# Base image for building imgproxy and its dependencies.
2+
ARG BASE_IMAGE=public.ecr.aws/ubuntu/ubuntu:22.04
3+
4+
# Use ubuntu 22.04 as a base image to link against glibc 2.35.
5+
FROM ${BASE_IMAGE} AS base
36

47
RUN apt-get update \
58
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@@ -28,7 +31,8 @@ FROM base AS deps
2831

2932
COPY install-rust.sh ./
3033

31-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
34+
RUN apt-get update \
35+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
3236
autoconf \
3337
autopoint \
3438
automake \
@@ -62,24 +66,52 @@ RUN ./install-go.sh
6266

6367
# ==============================================================================
6468

65-
FROM public.ecr.aws/debian/debian:bullseye-slim AS final
69+
FROM ${BASE_IMAGE} AS final
6670
LABEL maintainer="Sergey Alexandrovich <darthsim@gmail.com>"
6771

6872
RUN apt-get update \
6973
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7074
bash \
7175
curl \
72-
git \
7376
ca-certificates \
7477
build-essential \
7578
pkg-config \
7679
libssl-dev \
77-
libstdc++-10-dev
80+
libstdc++-10-dev \
81+
software-properties-common \
82+
gpg-agent \
83+
&& apt-get clean \
84+
&& truncate -s 0 /var/log/*log \
85+
&& rm -rf /tmp/* \
86+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
87+
88+
# Install LLVM 20 (for clang-format) and latest git (custom, newer versions)
89+
RUN echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main" > /etc/apt/sources.list.d/llvm20.list \
90+
&& curl -sSL https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
91+
92+
RUN apt-add-repository ppa:git-core/ppa
93+
94+
RUN apt-get update \
95+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
96+
git \
97+
clang-format \
98+
&& apt-get clean \
99+
&& truncate -s 0 /var/log/*log \
100+
&& rm -rf /tmp/* \
101+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
78102

79103
WORKDIR /root
80104

81105
COPY --from=golang /usr/local/go /usr/local/go
82-
ENV PATH=$PATH:/usr/local/go/bin
106+
ENV PATH=$PATH:/usr/local/go/bin:/root/go/bin
107+
108+
RUN go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.5.0 \
109+
&& go install github.com/evilmartians/lefthook@latest \
110+
&& go install gotest.tools/gotestsum@latest \
111+
&& go install github.com/air-verse/air@latest \
112+
&& go clean -cache -modcache
113+
114+
COPY --from=deps /root/deps/lychee/lychee /usr/local/bin/lychee
83115

84116
COPY --from=deps /opt/imgproxy/lib /opt/imgproxy/lib
85117
COPY --from=deps /opt/imgproxy/include /opt/imgproxy/include
@@ -88,5 +120,7 @@ COPY --from=deps /opt/imgproxy/bin /opt/imgproxy/bin
88120
COPY --from=deps /root/.bashrc /root/.bashrc
89121
ENV BASH_ENV=/root/.bashrc
90122

123+
ENV IMGPROXY_IN_BASE_CONTAINER=true
124+
91125
WORKDIR /app
92126
CMD ["bash"]

download-deps.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,9 @@ mkdir $DEPS_SRC/vips
217217
cd $DEPS_SRC/vips
218218
curl -Ls https://github.com/libvips/libvips/releases/download/v$VIPS_VERSION/vips-$VIPS_VERSION.tar.xz \
219219
| tar -xJC . --strip-components=1
220+
221+
print_download_stage lychee $LYCHEE_VERSION
222+
mkdir $DEPS_SRC/lychee
223+
cd $DEPS_SRC/lychee
224+
curl -L "https://github.com/lycheeverse/lychee/releases/download/lychee-v${LYCHEE_VERSION}/lychee-$(uname -m)-unknown-linux-gnu.tar.gz" \
225+
| tar -xz

versions.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ export FRIBIDI_VERSION=1.0.16
3131
export PANGO_VERSION=1.57.0
3232
export LIBRSVG_VERSION=2.62.0
3333
export VIPS_VERSION=8.18.0
34+
35+
# dev depdendencies
36+
export LYCHEE_VERSION=0.20.1

0 commit comments

Comments
 (0)