Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This is the temporary workflow for building and pushing imgproxy-base images with v4-dev tag.
name: Build dev image

on:
workflow_dispatch:
inputs:
tag:
description: "The tag to push the image with"
required: true
default: "v4-dev"

concurrency:
group: build-v4-dev-${{ github.ref }}
cancel-in-progress: true

env:
BASE_IMAGE_NAME: ghcr.io/imgproxy/imgproxy-base

jobs:
build:
if: github.repository_owner == 'imgproxy'
strategy:
matrix:
build:
- arch: amd64
dockerPlatform: linux/amd64
image: linux-5.0
- arch: arm64
dockerPlatform: linux/arm64/v8
image: arm-3.0
runs-on:
- codebuild-imgproxy-${{ github.run_id }}-${{ github.run_attempt }}
- image:${{ matrix.build.image }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
tags: ${{ env.BASE_IMAGE_NAME }}:${{ github.event.inputs.tag }}-${{ matrix.build.arch }}
platforms: ${{ matrix.build.dockerPlatform }}
provenance: false
push: true

push_manifests:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push manifests
run: |
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
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"[dockerfile]": {
"editor.formatOnSave": false,
"editor.defaultFormatter": null
}
}
48 changes: 41 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Use Debian Bullseye as a base image to link against glibc 2.31.
FROM public.ecr.aws/debian/debian:bullseye-slim AS base
# Base image for building imgproxy and its dependencies.
ARG BASE_IMAGE=public.ecr.aws/ubuntu/ubuntu:22.04

# Use ubuntu 22.04 as a base image to link against glibc 2.35.
FROM ${BASE_IMAGE} AS base

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -27,7 +30,8 @@ FROM base AS deps

COPY install-rust.sh ./

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
autoconf \
autopoint \
automake \
Expand Down Expand Up @@ -61,24 +65,52 @@ RUN ./install-go.sh

# ==============================================================================

FROM public.ecr.aws/debian/debian:bullseye-slim AS final
FROM ${BASE_IMAGE} AS final
LABEL maintainer="Sergey Alexandrovich <[email protected]>"

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
bash \
curl \
git \
ca-certificates \
build-essential \
pkg-config \
libssl-dev \
libstdc++-10-dev
libstdc++-10-dev \
software-properties-common \
gpg-agent \
&& apt-get clean \
&& truncate -s 0 /var/log/*log \
&& rm -rf /tmp/* \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install LLVM 20 (for clang-format) and latest git (custom, newer versions)
RUN echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main" > /etc/apt/sources.list.d/llvm20.list \
&& curl -sSL https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -

RUN apt-add-repository ppa:git-core/ppa

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
clang-format \
&& apt-get clean \
&& truncate -s 0 /var/log/*log \
&& rm -rf /tmp/* \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /root

COPY --from=golang /usr/local/go /usr/local/go
ENV PATH=$PATH:/usr/local/go/bin
ENV PATH=$PATH:/usr/local/go/bin:/root/go/bin

RUN go install github.com/golangci/golangci-lint/v2/cmd/[email protected] \
&& go install github.com/evilmartians/lefthook@latest \
&& go install gotest.tools/gotestsum@latest \
&& go install github.com/air-verse/air@latest \
&& go clean -cache -modcache

COPY --from=deps /root/deps/lychee/lychee /usr/local/bin/lychee

COPY --from=deps /opt/imgproxy/lib /opt/imgproxy/lib
COPY --from=deps /opt/imgproxy/include /opt/imgproxy/include
Expand All @@ -87,5 +119,7 @@ COPY --from=deps /opt/imgproxy/bin /opt/imgproxy/bin
COPY --from=deps /root/.bashrc /root/.bashrc
ENV BASH_ENV=/root/.bashrc

ENV IMGPROXY_IN_BASE_CONTAINER=true

WORKDIR /app
CMD ["bash"]
6 changes: 6 additions & 0 deletions download-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,9 @@ mkdir $DEPS_SRC/vips
cd $DEPS_SRC/vips
curl -Ls https://github.com/libvips/libvips/releases/download/v$VIPS_VERSION/vips-$VIPS_VERSION.tar.xz \
| tar -xJC . --strip-components=1

print_download_stage lychee $LYCHEE_VERSION
mkdir $DEPS_SRC/lychee
cd $DEPS_SRC/lychee
curl -L "https://github.com/lycheeverse/lychee/releases/download/lychee-v${LYCHEE_VERSION}/lychee-$(uname -m)-unknown-linux-gnu.tar.gz" \
| tar -xz
3 changes: 3 additions & 0 deletions versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ export FRIBIDI_VERSION=1.0.16
export PANGO_VERSION=1.57.0
export LIBRSVG_VERSION=2.61.1
export VIPS_VERSION=8.17.2

# dev depdendencies
export LYCHEE_VERSION=0.20.1