Skip to content

Commit cca2167

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

File tree

5 files changed

+128
-7
lines changed

5 files changed

+128
-7
lines changed

.github/workflows/dev.yml

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

.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 \
@@ -27,7 +30,8 @@ FROM base AS deps
2730

2831
COPY install-rust.sh ./
2932

30-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
33+
RUN apt-get update \
34+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
3135
autoconf \
3236
autopoint \
3337
automake \
@@ -61,24 +65,52 @@ RUN ./install-go.sh
6165

6266
# ==============================================================================
6367

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

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

78102
WORKDIR /root
79103

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

83115
COPY --from=deps /opt/imgproxy/lib /opt/imgproxy/lib
84116
COPY --from=deps /opt/imgproxy/include /opt/imgproxy/include
@@ -87,5 +119,7 @@ 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+
ENV IMGPROXY_IN_BASE_CONTAINER=true
123+
90124
WORKDIR /app
91125
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)