Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile based on Ubuntu #16

Merged
merged 5 commits into from
Nov 19, 2021
Merged
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
66 changes: 47 additions & 19 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Cache Docker layers
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Build Fedora image
- name: Build Fedora image
id: docker_build_fedora
uses: docker/build-push-action@v2
with:
Expand All @@ -44,8 +41,7 @@ jobs:
tags: im-fedora27
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Testing Fedora Image
- name: Testing Fedora Image
run: |
docker run --rm -v $(pwd):/imgs im-fedora27 -resize 500 /imgs/test.jpg /imgs/test-resize.jpg
docker run --rm -v $(pwd):/imgs im-fedora27 -resize 500 /imgs/test.jpg webp:/imgs/test-jpg.webp
Expand All @@ -57,8 +53,7 @@ jobs:
docker run --rm -v $(pwd):/imgs im-fedora27 -resize 200 /imgs/test.tiff /imgs/test-resize.tiff
docker run --rm -v $(pwd):/imgs im-fedora27 -resize 200 /imgs/test.tiff webp:/imgs/test-tiff.webp
docker run --rm -v $(pwd):/imgs im-fedora27 /imgs/test.jpg -antialias -font NimbusRoman-Bold -pointsize 20 -gravity Southeast -annotate +15+15 'TEST' /imgs/test-text.jpg
-
name: Push Fedora image
- name: Push Fedora image
id: docker_push_fedora
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@v2
Expand All @@ -70,8 +65,7 @@ jobs:
tags: dpokidov/imagemagick:${{ github.event.release.tag_name }}-fedora27,dpokidov/imagemagick:latest-fedora27
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Build Debian Stretch Image
- name: Build Debian Stretch Image
id: docker_build_stretch
uses: docker/build-push-action@v2
with:
Expand All @@ -82,8 +76,7 @@ jobs:
tags: im-stretch
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Testing Debian Stretch Image
- name: Testing Debian Stretch Image
run: |
docker run --rm -v $(pwd):/imgs im-stretch -resize 500 /imgs/test.jpg /imgs/test-resize.jpg
docker run --rm -v $(pwd):/imgs im-stretch -resize 500 /imgs/test.jpg webp:/imgs/test-jpg.webp
Expand All @@ -94,7 +87,7 @@ jobs:
docker run --rm -v $(pwd):/imgs im-stretch -resize 200 /imgs/test.tiff /imgs/test-resize.tiff
docker run --rm -v $(pwd):/imgs im-stretch -resize 200 /imgs/test.tiff webp:/imgs/test-tiff.webp
docker run --rm -v $(pwd):/imgs im-stretch /imgs/test.jpg -antialias -font Helvetica-Bold -pointsize 20 -gravity Southeast -annotate +15+15 'TEST' /imgs/test-text.jpg
- name: Push Debian Stretch image
- name: Push Debian Stretch image
id: docker_push_stretch
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@v2
Expand All @@ -106,8 +99,7 @@ jobs:
tags: dpokidov/imagemagick:${{ github.event.release.tag_name }}-stretch,dpokidov/imagemagick:latest-stretch
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Build Debian Buster Image
- name: Build Debian Buster Image
id: docker_build_buster
uses: docker/build-push-action@v2
with:
Expand All @@ -118,8 +110,7 @@ jobs:
tags: im-buster
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Testing Debian Buster Image
- name: Testing Debian Buster Image
run: |
docker run --rm -v $(pwd):/imgs im-buster -resize 500 /imgs/test.jpg /imgs/test-resize.jpg
docker run --rm -v $(pwd):/imgs im-buster -resize 500 /imgs/test.jpg webp:/imgs/test-jpg.webp
Expand All @@ -145,3 +136,40 @@ jobs:
tags: dpokidov/imagemagick:${{ github.event.release.tag_name }},dpokidov/imagemagick:${{ github.event.release.tag_name }}-buster,dpokidov/imagemagick:latest-buster,dpokidov/imagemagick:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build Ubuntu Image
id: docker_build_ubuntu
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile.ubuntu
push: false
load: true
tags: im-ubuntu
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Testing Ubuntu Image
run: |
docker run --rm -v $(pwd):/imgs im-ubuntu -resize 500 /imgs/test.jpg /imgs/test-resize.jpg
docker run --rm -v $(pwd):/imgs im-ubuntu -resize 500 /imgs/test.jpg webp:/imgs/test-jpg.webp
docker run --rm -v $(pwd):/imgs im-ubuntu -resize 500 /imgs/test.jpg avif:/imgs/test-jpg.avif
docker run --rm -v $(pwd):/imgs im-ubuntu -resize 100 /imgs/test.png /imgs/test-resize.png
docker run --rm -v $(pwd):/imgs im-ubuntu -resize 100 /imgs/test.png webp:/imgs/test-png.webp
docker run --rm -v $(pwd):/imgs im-ubuntu -resize 100 /imgs/test.png avif:/imgs/test-png.avif
docker run --rm -v $(pwd):/imgs im-ubuntu /imgs/test.pdf /imgs/test-pdf.png
docker run --rm -v $(pwd):/imgs im-ubuntu /imgs/jpg-with-metadata.jpg /imgs/jpg-with-metadata.webp
docker run --rm -v $(pwd):/imgs im-ubuntu -resize 200 /imgs/test.tiff /imgs/test-resize.tiff
docker run --rm -v $(pwd):/imgs im-ubuntu -resize 200 /imgs/test.tiff webp:/imgs/test-tiff.webp
docker run --rm -v $(pwd):/imgs im-ubuntu -resize 200 /imgs/test.tiff avif:/imgs/test-tiff.avif
docker run --rm -v $(pwd):/imgs im-ubuntu /imgs/test.jpg -antialias -font Helvetica-Bold -pointsize 20 -gravity Southeast -annotate +15+15 'TEST' /imgs/test-text.jpg
- name: Push Ubuntu image
id: docker_push_ubuntu
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile.ubuntu
push: true
load: false
tags: dpokidov/imagemagick:${{ github.event.release.tag_name }},dpokidov/imagemagick:${{ github.event.release.tag_name }}-ubuntu,dpokidov/imagemagick:latest-ubuntu,dpokidov/imagemagick:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
2 changes: 1 addition & 1 deletion Dockerfile.buster
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN apt-get -y update && \
# Building ImageMagick
git clone https://github.com/ImageMagick/ImageMagick.git && \
cd ImageMagick && git checkout ${IM_VERSION} && \
./configure --without-magick-plus-plus --disable-docs --disable-static --with-libtiff && \
./configure --without-magick-plus-plus --disable-docs --disable-static --with-tiff && \
make && make install && \
ldconfig /usr/local/lib && \
apt-get remove --autoremove --purge -y gcc make cmake curl g++ yasm git autoconf pkg-config libpng-dev libjpeg62-turbo-dev libde265-dev libx265-dev libxml2-dev libtiff-dev libfontconfig1-dev libfreetype6-dev && \
Expand Down
51 changes: 51 additions & 0 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM ubuntu:latest

ENV DEBIAN_FRONTEND=noninteractive

ARG IM_VERSION=7.1.0-10
ARG LIB_HEIF_VERSION=1.12.0
ARG LIB_AOM_VERSION=3.2.0
ARG LIB_WEBP_VERSION=1.2.1

RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get install -y git make gcc pkg-config autoconf curl g++ \
# libaom
yasm cmake \
# libheif
libde265-0 libde265-dev libjpeg-turbo8 libjpeg-turbo8-dev x265 libx265-dev libtool \
# IM
libpng16-16 libpng-dev libjpeg-turbo8 libjpeg-turbo8-dev libgomp1 ghostscript libxml2-dev libxml2-utils libtiff-dev libfontconfig1-dev libfreetype6-dev && \
# Building libwebp
git clone https://chromium.googlesource.com/webm/libwebp && \
cd libwebp && git checkout v${LIB_WEBP_VERSION} && \
./autogen.sh && ./configure --enable-shared --enable-libwebpdecoder --enable-libwebpdemux --enable-libwebpmux --enable-static=no && \
make && make install && \
ldconfig /usr/local/lib && \
cd ../ && rm -rf libwebp && \
# Building libaom
git clone https://aomedia.googlesource.com/aom && \
cd aom && git checkout v${LIB_AOM_VERSION} && cd .. && \
mkdir build_aom && \
cd build_aom && \
cmake ../aom/ -DENABLE_TESTS=0 -DBUILD_SHARED_LIBS=1 && make && make install && \
ldconfig /usr/local/lib && \
cd .. && \
rm -rf aom && \
rm -rf build_aom && \
# Building libheif
curl -L https://github.com/strukturag/libheif/releases/download/v${LIB_HEIF_VERSION}/libheif-${LIB_HEIF_VERSION}.tar.gz -o libheif.tar.gz && \
tar -xzvf libheif.tar.gz && cd libheif-${LIB_HEIF_VERSION}/ && ./autogen.sh && ./configure && make && make install && cd .. && \
ldconfig /usr/local/lib && \
rm -rf libheif-${LIB_HEIF_VERSION} && rm libheif.tar.gz && \
# Building ImageMagick
git clone https://github.com/ImageMagick/ImageMagick.git && \
cd ImageMagick && git checkout ${IM_VERSION} && \
./configure --without-magick-plus-plus --disable-docs --disable-static --with-tiff && \
make && make install && \
ldconfig /usr/local/lib && \
apt-get remove --autoremove --purge -y gcc make cmake curl g++ yasm git autoconf pkg-config libpng-dev libjpeg62-turbo-dev libde265-dev libx265-dev libxml2-dev libtiff-dev libfontconfig1-dev libfreetype6-dev && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /ImageMagick

ENTRYPOINT ["convert"]