Skip to content
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
22 changes: 20 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
repository: ${{ vars.repository }}
tags: ${{ needs.tags.outputs.tags }}
secrets: inherit
needs: [tags, crayfish]
needs: [tags, crayfish, imagemagick]
hypercube:
uses: ./.github/workflows/build.yml
with:
Expand All @@ -155,7 +155,16 @@ jobs:
repository: ${{ vars.repository }}
tags: ${{ needs.tags.outputs.tags }}
secrets: inherit
needs: [tags, crayfish]
needs: [tags, crayfish, leptonica]
imagemagick:
uses: ./.github/workflows/build.yml
with:
contexts: ${{ needs.base.outputs.context }}
image: imagemagick
repository: ${{ vars.repository }}
tags: ${{ needs.tags.outputs.tags }}
secrets: inherit
needs: [tags]
java:
uses: ./.github/workflows/build.yml
with:
Expand All @@ -165,6 +174,15 @@ jobs:
tags: ${{ needs.tags.outputs.tags }}
secrets: inherit
needs: [tags, base]
leptonica:
uses: ./.github/workflows/build.yml
with:
contexts: ${{ needs.base.outputs.context }}
image: leptonica
repository: ${{ vars.repository }}
tags: ${{ needs.tags.outputs.tags }}
secrets: inherit
needs: [tags]
mariadb:
uses: ./.github/workflows/build.yml
with:
Expand Down
74 changes: 61 additions & 13 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ IMAGES = [
"homarus",
"houdini",
"hypercube",
"imagemagick",
"java",
"leptonica",
"mariadb",
"milliner",
"nginx",
Expand All @@ -43,8 +45,8 @@ DEPENDENCIES = {
fits = ["tomcat"]
handle = ["java"]
homarus = ["crayfish"]
houdini = ["crayfish"]
hypercube = ["crayfish"]
houdini = ["crayfish", "imagemagick"]
hypercube = ["crayfish", "leptonica"]
java = ["base"]
mariadb = ["base"]
milliner = ["crayfish"]
Expand Down Expand Up @@ -141,7 +143,6 @@ group "arm64" {
targets = targets("arm64")
}


###############################################################################
# Common target properties.
###############################################################################
Expand Down Expand Up @@ -182,10 +183,7 @@ target "base-common" {
# The digest (sha256 hash) is not platform specific but the digest for the manifest of all platforms.
# It will be the digest printed when you do: docker pull alpine:3.17.1
# Not the one displayed on DockerHub.
# N.B. This should match the value used in:
# - <https://github.com/Islandora-Devops/isle-imagemagick>
# - <https://github.com/Islandora-Devops/isle-leptonica>
alpine = "docker-image://alpine:3.20.2@sha256:0a4eaa0eecf5f8c050e5bba433f58c052be7587ee8af3e8b3910ef9ab5fbe9f5"
alpine = "docker-image://alpine:3.20.6@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f"
}
}

Expand Down Expand Up @@ -246,18 +244,21 @@ target "homarus-common" {
target "houdini-common" {
inherits = ["common"]
context = "houdini"
contexts = {
# Produced by this repository <https://github.com/Islandora-Devops/isle-imagemagick>.
imagemagick = "docker-image://islandora/imagemagick:alpine-3.20.2-imagemagick-7.1.1.36-r0@sha256:a1fa03a18e7e232e380d070d196dc2c0e0a8762dd385640b932e28fcacfd9b05"
}
}

target "hypercube-common" {
inherits = ["common"]
context = "hypercube"
}

target "imagemagick-common" {
inherits = ["common"]
context = "imagemagick"
contexts = {
# Produced by this repository <https://github.com/Islandora-Devops/isle-leptonica>.
leptonica = "docker-image://islandora/leptonica:alpine-3.20.2-leptonica-1.84.1-r0@sha256:9e9e46a328d8b55a61a352a6b06ff175f98e40cd5773c9bf93aac58fb56b65f7"
# The digest (sha256 hash) is not platform specific but the digest for the manifest of all platforms.
# It will be the digest printed when you do: docker pull alpine:3.17.1
# Not the one displayed on DockerHub.
alpine = "docker-image://alpine:3.20.6@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f"
}
}

Expand All @@ -266,6 +267,17 @@ target "java-common" {
context = "java"
}

target "leptonica-common" {
inherits = ["common"]
context = "leptonica"
contexts = {
# The digest (sha256 hash) is not platform specific but the digest for the manifest of all platforms.
# It will be the digest printed when you do: docker pull alpine:3.17.1
# Not the one displayed on DockerHub.
alpine = "docker-image://alpine:3.20.6@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f"
}
}

target "mariadb-common" {
inherits = ["common"]
context = "mariadb"
Expand Down Expand Up @@ -413,13 +425,25 @@ target "hypercube" {
tags = tags("hypercube", "")
}

target "imagemagick" {
inherits = ["imagemagick-common"]
cache-from = cacheFrom("imagemagick", hostArch())
tags = tags("imagemagick", "")
}

target "java" {
inherits = ["java-common"]
contexts = dependencies("java", "")
cache-from = cacheFrom("java", hostArch())
tags = tags("java", "")
}

target "leptonica" {
inherits = ["leptonica-common"]
cache-from = cacheFrom("leptonica", hostArch())
tags = tags("leptonica", "")
}

target "mariadb" {
inherits = ["mariadb-common"]
contexts = dependencies("mariadb", "")
Expand Down Expand Up @@ -583,13 +607,25 @@ target "hypercube-amd64" {
tags = tags("hypercube", "amd64")
}

target "imagemagick-amd64" {
inherits = ["imagemagick-common", "amd64-common"]
cache-from = cacheFrom("imagemagick", "amd64")
tags = tags("imagemagick", "amd64")
}

target "java-amd64" {
inherits = ["java-common", "amd64-common"]
contexts = dependencies("java", "amd64")
cache-from = cacheFrom("java", "amd64")
tags = tags("java", "amd64")
}

target "leptonica-amd64" {
inherits = ["leptonica-common", "amd64-common"]
cache-from = cacheFrom("leptonica", "amd64")
tags = tags("leptonica", "amd64")
}

target "mariadb-amd64" {
inherits = ["mariadb-common", "amd64-common"]
contexts = dependencies("mariadb", "amd64")
Expand Down Expand Up @@ -753,13 +789,25 @@ target "hypercube-arm64" {
tags = tags("hypercube", "arm64")
}

target "imagemagick-arm64" {
inherits = ["imagemagick-common", "arm64-common"]
cache-from = cacheFrom("imagemagick", "arm64")
tags = tags("imagemagick", "arm64")
}

target "java-arm64" {
inherits = ["java-common", "arm64-common"]
contexts = dependencies("java", "arm64")
cache-from = cacheFrom("java", "arm64")
tags = tags("java", "arm64")
}

target "leptonica-arm64" {
inherits = ["leptonica-common", "arm64-common"]
cache-from = cacheFrom("leptonica", "arm64")
tags = tags("leptonica", "arm64")
}

target "mariadb-arm64" {
inherits = ["mariadb-common", "arm64-common"]
contexts = dependencies("mariadb", "arm64")
Expand Down
63 changes: 63 additions & 0 deletions imagemagick/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# syntax=docker/dockerfile:1.5.1
FROM alpine

ARG TARGETARCH

RUN --mount=type=cache,id=abuild-apk-${TARGETARCH},sharing=locked,target=/var/cache/apk \
apk add \
alpine-sdk \
bash \
sudo \
&& \
adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D builder && \
echo "builder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

ENV PACKAGER="Nigel Banks <nigel.g.banks@gmail.com>"

USER builder

SHELL ["/bin/bash", "-c"]

ARG TARGETARCH

# Platform specific does require arch specific identifier.
RUN --mount=type=cache,id=imagemagick-apk-${TARGETARCH},sharing=locked,target=/var/cache/apk \
export PACKAGES=(\
chrpath \
fftw-dev \
fontconfig-dev \
freetype-dev \
ghostscript-dev \
ghostscript-fonts \
graphviz \
lcms2-dev \
libheif-dev \
libjpeg-turbo-dev \
libjxl-dev \
libpng-dev \
libraw-dev \
librsvg-dev \
libtool \
libwebp-dev \
libwmf-dev \
libx11-dev \
libxext-dev \
libxml2-dev \
openexr-dev \
openjpeg-dev \
pango-dev \
perl-dev \
tiff-dev \
zlib-dev \
) && \
sudo apk add "${PACKAGES[@]}"

RUN --mount=type=bind,readwrite=true,source=build,target=/build \
sudo mkdir -p /packages && \
sudo chown -R builder /build && \
cd /build && \
abuild-keygen -ain && \
abuild-apk update && \
abuild && \
sudo apk del "${PACKAGES[@]}" && \
sudo mv $(find /home/builder/packages/* -type f) /packages
20 changes: 20 additions & 0 deletions imagemagick/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Imagemagick

Docker image for `imagemagick` package.

It is not meant to be deployed as a service, but rather as base to import our
custom imagemagick build into containers like `islandora/houdini`.

Consumers are expected to follow this pattern:

```dockerfile
FROM islandora/imagemagick:latest as imagemagick

FROM some_image:latest

RUN --mount=type=bind,from=imagemagick,source=/home/builder/packages/x86_64,target=/packages \
--mount=type=bind,from=imagemagick,source=/etc/apk/keys,target=/etc/apk/keys \
apk add /packages/imagemagick-*.apk && \
... other build steps ... && \
cleanup.sh
```
Loading
Loading