Skip to content

Commit 3767caa

Browse files
committed
ubuntu-22.04, all dev deps in the container
1 parent 4b5c040 commit 3767caa

File tree

4 files changed

+148
-32
lines changed

4 files changed

+148
-32
lines changed

.github/workflows/build-v4-dev.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This is the temporary workflow for building and pushing imgproxy-base images with v4-dev tag.
2+
name: Build V4 Dev image
3+
4+
on:
5+
push:
6+
7+
env:
8+
DOCKER_META_IMAGES: |
9+
ghcr.io/imgproxy/imgproxy-base
10+
11+
concurrency:
12+
group: build-v4-dev-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
if: github.repository_owner == 'imgproxy'
18+
strategy:
19+
matrix:
20+
build:
21+
- arch: amd64
22+
dockerPlatform: linux/amd64
23+
image: linux-5.0
24+
- arch: arm64
25+
dockerPlatform: linux/arm64/v8
26+
image: arm-3.0
27+
runs-on:
28+
- codebuild-imgproxy-${{ github.run_id }}-${{ github.run_attempt }}
29+
- image:${{ matrix.build.image }}
30+
permissions:
31+
contents: read
32+
packages: write
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Login to GitHub Container Registry
38+
uses: docker/login-action@v3
39+
with:
40+
registry: ghcr.io
41+
username: ${{ github.actor }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Build and push
45+
uses: docker/build-push-action@v6
46+
with:
47+
tags: ghcr.io/imgproxy/imgproxy-base:v4-dev-${{ matrix.build.arch }}
48+
platforms: ${{ matrix.build.dockerPlatform }}
49+
provenance: false
50+
push: true
51+
52+
push_manifests:
53+
needs: build
54+
runs-on: ubuntu-latest
55+
permissions:
56+
contents: read
57+
packages: write
58+
steps:
59+
- name: Login to GitHub Container Registry
60+
uses: docker/login-action@v3
61+
with:
62+
registry: ghcr.io
63+
username: ${{ github.actor }}
64+
password: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Push manifests
67+
run: |
68+
docker buildx imagetools create -t ghcr.io/imgproxy/imgproxy-base:v4-dev ghcr.io/imgproxy/imgproxy-base:v4-dev-amd64 ghcr.io/imgproxy/imgproxy-base:v4-dev-arm64

Dockerfile

Lines changed: 71 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
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+
# Use ubuntu 22.04 as a base image to link against glibc 2.35.
2+
FROM public.ecr.aws/ubuntu/ubuntu:22.04 AS base
33

44
RUN apt-get update \
55
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
6-
bash \
7-
curl \
8-
git \
9-
ca-certificates \
10-
build-essential \
11-
pkg-config \
12-
libssl-dev \
13-
libstdc++-10-dev
6+
bash \
7+
curl \
8+
git \
9+
ca-certificates \
10+
build-essential \
11+
pkg-config \
12+
libssl-dev \
13+
libstdc++-10-dev \
14+
&& apt-get clean \
15+
&& truncate -s 0 /var/log/*log \
16+
&& rm -rf /tmp/* \
17+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1418

1519
WORKDIR /root
1620

@@ -27,20 +31,25 @@ FROM base AS deps
2731

2832
COPY install-rust.sh ./
2933

30-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
31-
autoconf \
32-
autopoint \
33-
automake \
34-
cmake \
35-
nasm \
36-
libtool \
37-
python3-pip \
38-
python3-venv \
39-
gettext \
40-
gperf \
34+
RUN apt-get update \
35+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
36+
autoconf \
37+
autopoint \
38+
automake \
39+
cmake \
40+
nasm \
41+
libtool \
42+
python3-pip \
43+
python3-venv \
44+
gettext \
45+
gperf \
4146
&& ./install-rust.sh \
4247
&& python3 -m venv /root/.python \
43-
&& /root/.python/bin/pip install meson ninja packaging
48+
&& /root/.python/bin/pip install meson ninja packaging \
49+
&& apt-get clean \
50+
&& truncate -s 0 /var/log/*log \
51+
&& rm -rf /tmp/* \
52+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
4453

4554
COPY versions.sh build-deps.sh build-bash-profile.sh *.patch ./
4655
COPY --from=deps-src /root/deps /root/deps
@@ -61,24 +70,47 @@ RUN ./install-go.sh
6170

6271
# ==============================================================================
6372

64-
FROM public.ecr.aws/debian/debian:bullseye-slim AS final
73+
FROM public.ecr.aws/ubuntu/ubuntu:22.04 AS final
6574
LABEL maintainer="Sergey Alexandrovich <[email protected]>"
6675

76+
ENV IMGPROXY_IN_BASE_CONTAINER=true
77+
6778
RUN apt-get update \
6879
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
69-
bash \
70-
curl \
71-
git \
72-
ca-certificates \
73-
build-essential \
74-
pkg-config \
75-
libssl-dev \
76-
libstdc++-10-dev
80+
bash \
81+
curl \
82+
ca-certificates \
83+
build-essential \
84+
pkg-config \
85+
libssl-dev \
86+
libstdc++-10-dev \
87+
clang-format \
88+
software-properties-common \
89+
gpg-agent \
90+
&& apt-get clean \
91+
&& truncate -s 0 /var/log/*log \
92+
&& rm -rf /tmp/* \
93+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
94+
95+
# Install LLVM 20 (for clang-format) and latest git (custom, newer versions)
96+
RUN echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main" > /etc/apt/sources.list.d/llvm20.list \
97+
&& curl -sSL https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
98+
99+
RUN apt-add-repository ppa:git-core/ppa
100+
101+
RUN apt-get update \
102+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
103+
git \
104+
clang-format \
105+
&& apt-get clean \
106+
&& truncate -s 0 /var/log/*log \
107+
&& rm -rf /tmp/* \
108+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
77109

78110
WORKDIR /root
79111

80112
COPY --from=golang /usr/local/go /usr/local/go
81-
ENV PATH=$PATH:/usr/local/go/bin
113+
ENV PATH=$PATH:/usr/local/go/bin:/root/go/bin
82114

83115
COPY --from=deps /opt/imgproxy/lib /opt/imgproxy/lib
84116
COPY --from=deps /opt/imgproxy/include /opt/imgproxy/include
@@ -87,5 +119,12 @@ COPY --from=deps /opt/imgproxy/bin /opt/imgproxy/bin
87119
COPY --from=deps /root/.bashrc /root/.bashrc
88120
ENV BASH_ENV=/root/.bashrc
89121

122+
# dev dependencies
123+
COPY --from=deps /root/deps/lychee/lychee /usr/local/bin/lychee
124+
RUN go install github.com/golangci/golangci-lint/v2/cmd/[email protected] && go clean -cache -modcache
125+
RUN go install github.com/air-verse/air@latest && go clean -cache -modcache
126+
RUN go install github.com/evilmartians/lefthook@latest && go clean -cache -modcache
127+
RUN go install gotest.tools/gotestsum@latest && go clean -cache -modcache
128+
90129
WORKDIR /app
91130
CMD ["bash"]

download-deps.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,9 @@ mkdir $DEPS_SRC/vips
229229
cd $DEPS_SRC/vips
230230
curl -Ls https://github.com/libvips/libvips/releases/download/v$VIPS_VERSION/vips-$VIPS_VERSION.tar.xz \
231231
| tar -xJC . --strip-components=1
232+
233+
print_download_stage lychee $LYCHEE_VERSION
234+
mkdir $DEPS_SRC/lychee
235+
cd $DEPS_SRC/lychee
236+
curl -L "https://github.com/lycheeverse/lychee/releases/download/lychee-v${LYCHEE_VERSION}/lychee-$(uname -m)-unknown-linux-gnu.tar.gz" \
237+
| tar -xz

versions.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ export FRIBIDI_VERSION=1.0.16
3333
export PANGO_VERSION=1.57.0
3434
export LIBRSVG_VERSION=2.61.1
3535
export VIPS_VERSION=8.17.2
36+
37+
# dev depdendencies
38+
export LYCHEE_VERSION=0.20.1

0 commit comments

Comments
 (0)