diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 957c881..e0353fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,31 +5,28 @@ on: [push, pull_request] jobs: build: name: Test - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: CGO_CFLAGS_ALLOW: -Xpreprocessor - VIPS_VERSION: 8.14.3 + VIPS_VERSION: 8.14.5 FFMPEG_VERSION: 5.1.2 - V: 2 + V: 4 steps: - name: Set up Go 1.x uses: actions/setup-go@v2 with: - go-version: ^1.20 + go-version: ^1.21 - name: Check out code uses: actions/checkout@v2 - name: Install linux dependencies run: | - sudo add-apt-repository -y ppa:lovell/cgif - sudo add-apt-repository -y ppa:strukturag/libde265 - sudo add-apt-repository -y ppa:strukturag/libheif sudo apt-get update sudo apt-get install -y \ - python3-pip ninja-build \ - glib-2.0-dev libexpat-dev librsvg2-dev libpng-dev \ + meson ninja-build \ + libglib2.0-dev libexpat-dev librsvg2-dev libpng-dev \ libjpeg-turbo8-dev libimagequant-dev libfftw3-dev \ libpoppler-glib-dev libxml2-dev \ libopenslide-dev libcfitsio-dev liborc-0.4-dev libpango1.0-dev \ @@ -37,7 +34,6 @@ jobs: yasm libx264-dev libx265-dev libnuma-dev libvpx-dev libtheora-dev \ librtmp-dev libvorbis-dev \ libopenjp2-7-dev libcgif-dev - sudo pip3 install meson - name: Cache libvips uses: actions/cache@v3 diff --git a/Dockerfile b/Dockerfile index a7f1583..55d9755 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,13 @@ -ARG GOLANG_VERSION=1.20.6 -FROM golang:${GOLANG_VERSION}-bullseye as builder +ARG GOLANG_VERSION=1.21.4 +FROM golang:${GOLANG_VERSION}-bookworm as builder ARG FFMPEG_VERSION=5.1.2 ARG VIPS_VERSION=8.14.3 -ARG CGIF_VERSION=0.3.0 -ARG LIBSPNG_VERSION=0.7.3 ARG TARGETARCH ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ENV MAKEFLAGS="-j8" -# libaom3 is in Debian bullseye-backports -RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/backports.list # Installs libvips + required libraries RUN DEBIAN_FRONTEND=noninteractive \ @@ -19,33 +15,13 @@ RUN DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y \ ca-certificates \ automake build-essential curl \ - python3-pip ninja-build pkg-config \ + meson ninja-build pkg-config \ gobject-introspection gtk-doc-tools libglib2.0-dev libjpeg62-turbo-dev libpng-dev \ - libwebp-dev libtiff5-dev libexif-dev libxml2-dev libpoppler-glib-dev \ + libwebp-dev libtiff-dev libexif-dev libxml2-dev libpoppler-glib-dev \ swig libpango1.0-dev libmatio-dev libopenslide-dev libcfitsio-dev libopenjp2-7-dev \ - libgsf-1-dev fftw3-dev liborc-0.4-dev librsvg2-dev libimagequant-dev libaom-dev/bullseye-backports libheif-dev \ + libgsf-1-dev libfftw3-dev liborc-0.4-dev librsvg2-dev libimagequant-dev libaom-dev libheif-dev \ yasm libx264-dev libx265-dev libnuma-dev libvpx-dev libtheora-dev \ - librtmp-dev libvorbis-dev && \ - pip3 install meson && \ - cd /tmp && \ - curl -fsSLO https://github.com/dloebl/cgif/archive/refs/tags/V${CGIF_VERSION}.tar.gz && \ - tar xf V${CGIF_VERSION}.tar.gz && \ - cd cgif-${CGIF_VERSION} && \ - meson build --prefix=/usr/local --libdir=/usr/local/lib --buildtype=release && \ - cd build && \ - ninja && \ - ninja install && \ - cd /tmp && \ - curl -fsSLO https://github.com/randy408/libspng/archive/refs/tags/v${LIBSPNG_VERSION}.tar.gz && \ - tar xf v${LIBSPNG_VERSION}.tar.gz && \ - cd libspng-${LIBSPNG_VERSION} && \ - meson setup _build \ - --buildtype=release \ - --strip \ - --prefix=/usr/local \ - --libdir=lib && \ - ninja -C _build && \ - ninja -C _build install && \ + libspng-dev libcgif-dev librtmp-dev libvorbis-dev && \ cd /tmp && \ curl -fsSLO https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.xz && \ tar xf vips-${VIPS_VERSION}.tar.xz && \ @@ -98,22 +74,22 @@ COPY . . RUN if [ "$TARGETARCH" = "amd64" ]; then go test ./...; fi RUN go build -o ${GOPATH}/bin/imagorvideo ./cmd/imagorvideo/main.go -FROM debian:bullseye-slim +FROM debian:bookworm-slim LABEL maintainer="adrian@cshum.com" COPY --from=builder /usr/local/lib /usr/local/lib COPY --from=builder /etc/ssl/certs /etc/ssl/certs -COPY --from=builder /etc/apt/sources.list.d/backports.list /etc/apt/sources.list.d/backports.list # Install runtime dependencies RUN DEBIAN_FRONTEND=noninteractive \ apt-get update && \ apt-get install --no-install-recommends -y \ - procps libglib2.0-0 libjpeg62-turbo libpng16-16 libopenexr25 \ - libwebp6 libwebpmux3 libwebpdemux2 libtiff5 libexif12 libxml2 libpoppler-glib8 \ + procps libglib2.0-0 libjpeg62-turbo libpng16-16 libopenexr-3-1-30 \ + libwebp7 libwebpmux3 libwebpdemux2 libtiff6 libexif12 libxml2 libpoppler-glib8 \ libpango1.0-0 libmatio11 libopenslide0 libopenjp2-7 libjemalloc2 \ - libgsf-1-114 fftw3 liborc-0.4-0 librsvg2-2 libcfitsio9 libimagequant0 libaom3 libheif1 \ - libx264-dev libx265-dev libnuma-dev libvpx6 libtheora0 libvorbis-dev && \ + libgsf-1-114 libfftw3-bin liborc-0.4-0 librsvg2-2 libcfitsio10 libimagequant0 libaom3 libheif1 \ + libx264-dev libx265-dev libnuma-dev libvpx6 libtheora0 libvorbis-dev \ + libspng0 libcgif0 && \ ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so && \ apt-get autoremove -y && \ apt-get autoclean && \